cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A387051 Number of entries in the n-th row of Pascal's triangle not divisible by 32.

This page as a plain text file.
%I A387051 #5 Aug 19 2025 05:33:58
%S A387051 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,
%T A387051 27,28,29,30,31,32,17,34,27,36,29,38,35,40,33,42,39,44,41,46,45,48,41,
%U A387051 50,47,52,49,54,53,56,53,58,57,60,59,62,62,64,17,34,43,68
%N A387051 Number of entries in the n-th row of Pascal's triangle not divisible by 32.
%o A387051 (Python)
%o A387051 def A387051(n):
%o A387051     n1 = n>>1
%o A387051     n2 = n1>>1
%o A387051     n3 = n2>>1
%o A387051     n4 = n3>>1
%o A387051     np = ~n
%o A387051     n10, n100, n110 = (k1:=n1&np).bit_count(), (k2:=(k1>>1)&np).bit_count(), (k3:=n2&k1).bit_count()
%o A387051     n1100, n1000, n1010, n1110 = (k5:=n3&k2).bit_count(), (k4:=(k2>>1)&np).bit_count(), (k6:=(k1>>2)&k1).bit_count(), (k7:=n3&k3).bit_count()
%o A387051     n10000, n11000, n10100, n11100 = ((k4>>1)&np).bit_count(), (n4&k4).bit_count(), ((k6>>1)&np).bit_count(), (n4&k5).bit_count()
%o A387051     n10010, n11010, n10110, n11110 = ((k2>>2)&k1).bit_count(), (n4&k6).bit_count(), ((k1>>3)&k3).bit_count(), (n4&k7).bit_count()
%o A387051     c = n10*(n10*(n10*(n10+2)+((n100<<2)+n110)*12+35)+((((((n1000<<2)+n1010+n1100<<1)+n100<<1)+n1110<<1)+n110)*12+154))//24
%o A387051     c += n100*((n100<<1)+n110+1<<2)+(((n10000<<2)+n1000+n10010+n10100+n11000+1<<2)+n10110+n11010+n11100<<2)+n1110+n11110+(n110*(n110+5)>>1)
%o A387051     return c<<n.bit_count()>>4
%Y A387051 Cf. A001316, A006047, A194459, A382720-A382725, A386952, A387050.
%K A387051 nonn
%O A387051 0,2
%A A387051 _Chai Wah Wu_, Aug 15 2025