Last active
June 11, 2021 23:04
-
-
Save tkmharris/2f9fe09171b6824696e885912b7ea9dc to your computer and use it in GitHub Desktop.
Code for OEIS sequence 345225
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Function to calculate terms of OEIS sequence A345225. | |
""" | |
def a345225(n): | |
""" | |
Calculate OEIS entry A345225(n) | |
(Orders of 2-primary subgroups of K_n(Z), the algebraic K-theory of the integers.) | |
n: int, >=0 | |
return: int | |
""" | |
n_ = (n % 8) | |
d = {0:1, 1:2, 2:2, 3:16, 4:1, 5:1, 6:1} | |
if n_ == 7: | |
return 2*(n+1) | |
else: | |
return d[n_] | |
""" | |
# uncomment this block to print 50 sample values | |
print(",".join([str(a345225(n)) for n in range(0, 50)])) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to generate b-file. | |
""" | |
from a345225 import a345225 | |
def b345225(n=1000): | |
""" | |
Generate b-file for OEIS entry A345225. | |
n: int, >=1 | |
return: None | |
""" | |
bfile = "b345225.txt" | |
with open(bfile, 'w') as f: | |
f.writelines([f"{i} {a345225(i)}\n" for i in range(0, n)]) | |
b345225() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 1 | |
1 2 | |
2 2 | |
3 16 | |
4 1 | |
5 1 | |
6 1 | |
7 16 | |
8 1 | |
9 2 | |
10 2 | |
11 16 | |
12 1 | |
13 1 | |
14 1 | |
15 32 | |
16 1 | |
17 2 | |
18 2 | |
19 16 | |
20 1 | |
21 1 | |
22 1 | |
23 48 | |
24 1 | |
25 2 | |
26 2 | |
27 16 | |
28 1 | |
29 1 | |
30 1 | |
31 64 | |
32 1 | |
33 2 | |
34 2 | |
35 16 | |
36 1 | |
37 1 | |
38 1 | |
39 80 | |
40 1 | |
41 2 | |
42 2 | |
43 16 | |
44 1 | |
45 1 | |
46 1 | |
47 96 | |
48 1 | |
49 2 | |
50 2 | |
51 16 | |
52 1 | |
53 1 | |
54 1 | |
55 112 | |
56 1 | |
57 2 | |
58 2 | |
59 16 | |
60 1 | |
61 1 | |
62 1 | |
63 128 | |
64 1 | |
65 2 | |
66 2 | |
67 16 | |
68 1 | |
69 1 | |
70 1 | |
71 144 | |
72 1 | |
73 2 | |
74 2 | |
75 16 | |
76 1 | |
77 1 | |
78 1 | |
79 160 | |
80 1 | |
81 2 | |
82 2 | |
83 16 | |
84 1 | |
85 1 | |
86 1 | |
87 176 | |
88 1 | |
89 2 | |
90 2 | |
91 16 | |
92 1 | |
93 1 | |
94 1 | |
95 192 | |
96 1 | |
97 2 | |
98 2 | |
99 16 | |
100 1 | |
101 1 | |
102 1 | |
103 208 | |
104 1 | |
105 2 | |
106 2 | |
107 16 | |
108 1 | |
109 1 | |
110 1 | |
111 224 | |
112 1 | |
113 2 | |
114 2 | |
115 16 | |
116 1 | |
117 1 | |
118 1 | |
119 240 | |
120 1 | |
121 2 | |
122 2 | |
123 16 | |
124 1 | |
125 1 | |
126 1 | |
127 256 | |
128 1 | |
129 2 | |
130 2 | |
131 16 | |
132 1 | |
133 1 | |
134 1 | |
135 272 | |
136 1 | |
137 2 | |
138 2 | |
139 16 | |
140 1 | |
141 1 | |
142 1 | |
143 288 | |
144 1 | |
145 2 | |
146 2 | |
147 16 | |
148 1 | |
149 1 | |
150 1 | |
151 304 | |
152 1 | |
153 2 | |
154 2 | |
155 16 | |
156 1 | |
157 1 | |
158 1 | |
159 320 | |
160 1 | |
161 2 | |
162 2 | |
163 16 | |
164 1 | |
165 1 | |
166 1 | |
167 336 | |
168 1 | |
169 2 | |
170 2 | |
171 16 | |
172 1 | |
173 1 | |
174 1 | |
175 352 | |
176 1 | |
177 2 | |
178 2 | |
179 16 | |
180 1 | |
181 1 | |
182 1 | |
183 368 | |
184 1 | |
185 2 | |
186 2 | |
187 16 | |
188 1 | |
189 1 | |
190 1 | |
191 384 | |
192 1 | |
193 2 | |
194 2 | |
195 16 | |
196 1 | |
197 1 | |
198 1 | |
199 400 | |
200 1 | |
201 2 | |
202 2 | |
203 16 | |
204 1 | |
205 1 | |
206 1 | |
207 416 | |
208 1 | |
209 2 | |
210 2 | |
211 16 | |
212 1 | |
213 1 | |
214 1 | |
215 432 | |
216 1 | |
217 2 | |
218 2 | |
219 16 | |
220 1 | |
221 1 | |
222 1 | |
223 448 | |
224 1 | |
225 2 | |
226 2 | |
227 16 | |
228 1 | |
229 1 | |
230 1 | |
231 464 | |
232 1 | |
233 2 | |
234 2 | |
235 16 | |
236 1 | |
237 1 | |
238 1 | |
239 480 | |
240 1 | |
241 2 | |
242 2 | |
243 16 | |
244 1 | |
245 1 | |
246 1 | |
247 496 | |
248 1 | |
249 2 | |
250 2 | |
251 16 | |
252 1 | |
253 1 | |
254 1 | |
255 512 | |
256 1 | |
257 2 | |
258 2 | |
259 16 | |
260 1 | |
261 1 | |
262 1 | |
263 528 | |
264 1 | |
265 2 | |
266 2 | |
267 16 | |
268 1 | |
269 1 | |
270 1 | |
271 544 | |
272 1 | |
273 2 | |
274 2 | |
275 16 | |
276 1 | |
277 1 | |
278 1 | |
279 560 | |
280 1 | |
281 2 | |
282 2 | |
283 16 | |
284 1 | |
285 1 | |
286 1 | |
287 576 | |
288 1 | |
289 2 | |
290 2 | |
291 16 | |
292 1 | |
293 1 | |
294 1 | |
295 592 | |
296 1 | |
297 2 | |
298 2 | |
299 16 | |
300 1 | |
301 1 | |
302 1 | |
303 608 | |
304 1 | |
305 2 | |
306 2 | |
307 16 | |
308 1 | |
309 1 | |
310 1 | |
311 624 | |
312 1 | |
313 2 | |
314 2 | |
315 16 | |
316 1 | |
317 1 | |
318 1 | |
319 640 | |
320 1 | |
321 2 | |
322 2 | |
323 16 | |
324 1 | |
325 1 | |
326 1 | |
327 656 | |
328 1 | |
329 2 | |
330 2 | |
331 16 | |
332 1 | |
333 1 | |
334 1 | |
335 672 | |
336 1 | |
337 2 | |
338 2 | |
339 16 | |
340 1 | |
341 1 | |
342 1 | |
343 688 | |
344 1 | |
345 2 | |
346 2 | |
347 16 | |
348 1 | |
349 1 | |
350 1 | |
351 704 | |
352 1 | |
353 2 | |
354 2 | |
355 16 | |
356 1 | |
357 1 | |
358 1 | |
359 720 | |
360 1 | |
361 2 | |
362 2 | |
363 16 | |
364 1 | |
365 1 | |
366 1 | |
367 736 | |
368 1 | |
369 2 | |
370 2 | |
371 16 | |
372 1 | |
373 1 | |
374 1 | |
375 752 | |
376 1 | |
377 2 | |
378 2 | |
379 16 | |
380 1 | |
381 1 | |
382 1 | |
383 768 | |
384 1 | |
385 2 | |
386 2 | |
387 16 | |
388 1 | |
389 1 | |
390 1 | |
391 784 | |
392 1 | |
393 2 | |
394 2 | |
395 16 | |
396 1 | |
397 1 | |
398 1 | |
399 800 | |
400 1 | |
401 2 | |
402 2 | |
403 16 | |
404 1 | |
405 1 | |
406 1 | |
407 816 | |
408 1 | |
409 2 | |
410 2 | |
411 16 | |
412 1 | |
413 1 | |
414 1 | |
415 832 | |
416 1 | |
417 2 | |
418 2 | |
419 16 | |
420 1 | |
421 1 | |
422 1 | |
423 848 | |
424 1 | |
425 2 | |
426 2 | |
427 16 | |
428 1 | |
429 1 | |
430 1 | |
431 864 | |
432 1 | |
433 2 | |
434 2 | |
435 16 | |
436 1 | |
437 1 | |
438 1 | |
439 880 | |
440 1 | |
441 2 | |
442 2 | |
443 16 | |
444 1 | |
445 1 | |
446 1 | |
447 896 | |
448 1 | |
449 2 | |
450 2 | |
451 16 | |
452 1 | |
453 1 | |
454 1 | |
455 912 | |
456 1 | |
457 2 | |
458 2 | |
459 16 | |
460 1 | |
461 1 | |
462 1 | |
463 928 | |
464 1 | |
465 2 | |
466 2 | |
467 16 | |
468 1 | |
469 1 | |
470 1 | |
471 944 | |
472 1 | |
473 2 | |
474 2 | |
475 16 | |
476 1 | |
477 1 | |
478 1 | |
479 960 | |
480 1 | |
481 2 | |
482 2 | |
483 16 | |
484 1 | |
485 1 | |
486 1 | |
487 976 | |
488 1 | |
489 2 | |
490 2 | |
491 16 | |
492 1 | |
493 1 | |
494 1 | |
495 992 | |
496 1 | |
497 2 | |
498 2 | |
499 16 | |
500 1 | |
501 1 | |
502 1 | |
503 1008 | |
504 1 | |
505 2 | |
506 2 | |
507 16 | |
508 1 | |
509 1 | |
510 1 | |
511 1024 | |
512 1 | |
513 2 | |
514 2 | |
515 16 | |
516 1 | |
517 1 | |
518 1 | |
519 1040 | |
520 1 | |
521 2 | |
522 2 | |
523 16 | |
524 1 | |
525 1 | |
526 1 | |
527 1056 | |
528 1 | |
529 2 | |
530 2 | |
531 16 | |
532 1 | |
533 1 | |
534 1 | |
535 1072 | |
536 1 | |
537 2 | |
538 2 | |
539 16 | |
540 1 | |
541 1 | |
542 1 | |
543 1088 | |
544 1 | |
545 2 | |
546 2 | |
547 16 | |
548 1 | |
549 1 | |
550 1 | |
551 1104 | |
552 1 | |
553 2 | |
554 2 | |
555 16 | |
556 1 | |
557 1 | |
558 1 | |
559 1120 | |
560 1 | |
561 2 | |
562 2 | |
563 16 | |
564 1 | |
565 1 | |
566 1 | |
567 1136 | |
568 1 | |
569 2 | |
570 2 | |
571 16 | |
572 1 | |
573 1 | |
574 1 | |
575 1152 | |
576 1 | |
577 2 | |
578 2 | |
579 16 | |
580 1 | |
581 1 | |
582 1 | |
583 1168 | |
584 1 | |
585 2 | |
586 2 | |
587 16 | |
588 1 | |
589 1 | |
590 1 | |
591 1184 | |
592 1 | |
593 2 | |
594 2 | |
595 16 | |
596 1 | |
597 1 | |
598 1 | |
599 1200 | |
600 1 | |
601 2 | |
602 2 | |
603 16 | |
604 1 | |
605 1 | |
606 1 | |
607 1216 | |
608 1 | |
609 2 | |
610 2 | |
611 16 | |
612 1 | |
613 1 | |
614 1 | |
615 1232 | |
616 1 | |
617 2 | |
618 2 | |
619 16 | |
620 1 | |
621 1 | |
622 1 | |
623 1248 | |
624 1 | |
625 2 | |
626 2 | |
627 16 | |
628 1 | |
629 1 | |
630 1 | |
631 1264 | |
632 1 | |
633 2 | |
634 2 | |
635 16 | |
636 1 | |
637 1 | |
638 1 | |
639 1280 | |
640 1 | |
641 2 | |
642 2 | |
643 16 | |
644 1 | |
645 1 | |
646 1 | |
647 1296 | |
648 1 | |
649 2 | |
650 2 | |
651 16 | |
652 1 | |
653 1 | |
654 1 | |
655 1312 | |
656 1 | |
657 2 | |
658 2 | |
659 16 | |
660 1 | |
661 1 | |
662 1 | |
663 1328 | |
664 1 | |
665 2 | |
666 2 | |
667 16 | |
668 1 | |
669 1 | |
670 1 | |
671 1344 | |
672 1 | |
673 2 | |
674 2 | |
675 16 | |
676 1 | |
677 1 | |
678 1 | |
679 1360 | |
680 1 | |
681 2 | |
682 2 | |
683 16 | |
684 1 | |
685 1 | |
686 1 | |
687 1376 | |
688 1 | |
689 2 | |
690 2 | |
691 16 | |
692 1 | |
693 1 | |
694 1 | |
695 1392 | |
696 1 | |
697 2 | |
698 2 | |
699 16 | |
700 1 | |
701 1 | |
702 1 | |
703 1408 | |
704 1 | |
705 2 | |
706 2 | |
707 16 | |
708 1 | |
709 1 | |
710 1 | |
711 1424 | |
712 1 | |
713 2 | |
714 2 | |
715 16 | |
716 1 | |
717 1 | |
718 1 | |
719 1440 | |
720 1 | |
721 2 | |
722 2 | |
723 16 | |
724 1 | |
725 1 | |
726 1 | |
727 1456 | |
728 1 | |
729 2 | |
730 2 | |
731 16 | |
732 1 | |
733 1 | |
734 1 | |
735 1472 | |
736 1 | |
737 2 | |
738 2 | |
739 16 | |
740 1 | |
741 1 | |
742 1 | |
743 1488 | |
744 1 | |
745 2 | |
746 2 | |
747 16 | |
748 1 | |
749 1 | |
750 1 | |
751 1504 | |
752 1 | |
753 2 | |
754 2 | |
755 16 | |
756 1 | |
757 1 | |
758 1 | |
759 1520 | |
760 1 | |
761 2 | |
762 2 | |
763 16 | |
764 1 | |
765 1 | |
766 1 | |
767 1536 | |
768 1 | |
769 2 | |
770 2 | |
771 16 | |
772 1 | |
773 1 | |
774 1 | |
775 1552 | |
776 1 | |
777 2 | |
778 2 | |
779 16 | |
780 1 | |
781 1 | |
782 1 | |
783 1568 | |
784 1 | |
785 2 | |
786 2 | |
787 16 | |
788 1 | |
789 1 | |
790 1 | |
791 1584 | |
792 1 | |
793 2 | |
794 2 | |
795 16 | |
796 1 | |
797 1 | |
798 1 | |
799 1600 | |
800 1 | |
801 2 | |
802 2 | |
803 16 | |
804 1 | |
805 1 | |
806 1 | |
807 1616 | |
808 1 | |
809 2 | |
810 2 | |
811 16 | |
812 1 | |
813 1 | |
814 1 | |
815 1632 | |
816 1 | |
817 2 | |
818 2 | |
819 16 | |
820 1 | |
821 1 | |
822 1 | |
823 1648 | |
824 1 | |
825 2 | |
826 2 | |
827 16 | |
828 1 | |
829 1 | |
830 1 | |
831 1664 | |
832 1 | |
833 2 | |
834 2 | |
835 16 | |
836 1 | |
837 1 | |
838 1 | |
839 1680 | |
840 1 | |
841 2 | |
842 2 | |
843 16 | |
844 1 | |
845 1 | |
846 1 | |
847 1696 | |
848 1 | |
849 2 | |
850 2 | |
851 16 | |
852 1 | |
853 1 | |
854 1 | |
855 1712 | |
856 1 | |
857 2 | |
858 2 | |
859 16 | |
860 1 | |
861 1 | |
862 1 | |
863 1728 | |
864 1 | |
865 2 | |
866 2 | |
867 16 | |
868 1 | |
869 1 | |
870 1 | |
871 1744 | |
872 1 | |
873 2 | |
874 2 | |
875 16 | |
876 1 | |
877 1 | |
878 1 | |
879 1760 | |
880 1 | |
881 2 | |
882 2 | |
883 16 | |
884 1 | |
885 1 | |
886 1 | |
887 1776 | |
888 1 | |
889 2 | |
890 2 | |
891 16 | |
892 1 | |
893 1 | |
894 1 | |
895 1792 | |
896 1 | |
897 2 | |
898 2 | |
899 16 | |
900 1 | |
901 1 | |
902 1 | |
903 1808 | |
904 1 | |
905 2 | |
906 2 | |
907 16 | |
908 1 | |
909 1 | |
910 1 | |
911 1824 | |
912 1 | |
913 2 | |
914 2 | |
915 16 | |
916 1 | |
917 1 | |
918 1 | |
919 1840 | |
920 1 | |
921 2 | |
922 2 | |
923 16 | |
924 1 | |
925 1 | |
926 1 | |
927 1856 | |
928 1 | |
929 2 | |
930 2 | |
931 16 | |
932 1 | |
933 1 | |
934 1 | |
935 1872 | |
936 1 | |
937 2 | |
938 2 | |
939 16 | |
940 1 | |
941 1 | |
942 1 | |
943 1888 | |
944 1 | |
945 2 | |
946 2 | |
947 16 | |
948 1 | |
949 1 | |
950 1 | |
951 1904 | |
952 1 | |
953 2 | |
954 2 | |
955 16 | |
956 1 | |
957 1 | |
958 1 | |
959 1920 | |
960 1 | |
961 2 | |
962 2 | |
963 16 | |
964 1 | |
965 1 | |
966 1 | |
967 1936 | |
968 1 | |
969 2 | |
970 2 | |
971 16 | |
972 1 | |
973 1 | |
974 1 | |
975 1952 | |
976 1 | |
977 2 | |
978 2 | |
979 16 | |
980 1 | |
981 1 | |
982 1 | |
983 1968 | |
984 1 | |
985 2 | |
986 2 | |
987 16 | |
988 1 | |
989 1 | |
990 1 | |
991 1984 | |
992 1 | |
993 2 | |
994 2 | |
995 16 | |
996 1 | |
997 1 | |
998 1 | |
999 2000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment