A273514 a(n) is the number of arithmetic progressions m < n < p (three numbers in arithmetic progression) such that m and p contain no 2's in their ternary representation.
0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 2, 0, 0, 2, 2, 2, 2, 2, 2, 8, 2, 2, 2, 2, 2, 2, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 2, 0, 0, 2, 2, 2, 2, 2, 2, 8, 2, 2, 2, 2, 2, 2, 2, 2, 8, 2, 2, 8, 8, 8, 8, 2, 2, 8, 2, 2, 2, 2, 2, 2, 2, 2, 8, 2, 2, 2, 2, 2, 2, 0, 0, 2, 0, 0, 2
Offset: 0
Examples
a(2) = 2 because there are two arithmetic triples a < 2 < b such that a and b are members of A005836: 0, 2, 4 and 1, 2, 3.
Links
- Max Barrentine, Table of n, a(n) for n = 0..19683
Programs
-
PARI
precCantor(n)=my(v=digits(n,3)); for(i=1,#v, if(v[i]==2, for(j=i,#v,v[j]=1); break)); fromdigits(v,2) a(n)=if(n==0, return(0)); sum(i=0,precCantor(n-1), my(m=fromdigits(digits(i,2),3)); vecmax(digits(2*n-m,3))<2) \\ Charles R Greathouse IV, Jun 17 2016
Formula
a(0) = 0, a(n) = a(3n) = a(3n+1); if a(n) = 0, a(9n + 2) = 2, otherwise a(9n + 2) = 4a(n); a(9n + 5) = a(9n + 6) = a(9n + 7) = a(9n + 8) = a(3n + 2).
Comments