A228132 First differences of A014311.
4, 2, 1, 5, 2, 1, 3, 1, 2, 7, 2, 1, 3, 1, 2, 5, 1, 2, 4, 11, 2, 1, 3, 1, 2, 5, 1, 2, 4, 9, 1, 2, 4, 8, 19, 2, 1, 3, 1, 2, 5, 1, 2, 4, 9, 1, 2, 4, 8, 17, 1, 2, 4, 8, 16, 35, 2, 1, 3, 1, 2, 5, 1, 2, 4, 9, 1, 2, 4, 8, 17, 1, 2, 4, 8, 16, 33, 1, 2, 4, 8, 16, 32
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
JavaScript
oo=0; for (i=1;i<500;i++) { s=i.toString(2); o=0; for (j=0;j
-
Mathematica
Differences[Select[Range[500],DigitCount[#,2,1]==3&]] (* Harvey P. Dale, May 29 2018 *)
-
PARI
lista(nn) = {my(last = 0); for (n=1, nn, if (hammingweight(n)==3, if (last, print1(n-last,", ")); last = n;););} \\ Michel Marcus, Jun 10 2015
-
Python
from math import isqrt, comb from sympy import integer_nthroot def A228132(n): return (1<<(r:=n-comb((m:=integer_nthroot(6*n+6,3)[0])+(t:=(n>=comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))+(1<<(a:=isqrt(s:=n+1-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1))+(1<
comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))-(1<<(a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1))-(1< Chai Wah Wu, Apr 07 2025
Comments