OFFSET
0,2
COMMENTS
The definition implies that after 0 these are also all numbers n such that (A002828(1+n) = 1), (A002828(2+n) = 2), (A002828(3+n) = 3) and (A002828(4+n) = 4).
Because A002828 obtains value 1 only at squares, every term must be one less than a square.
In the terms of tree defined by edge relation A255131(child) = parent, ("the least squares beanstalk"), these numbers are the nodes with four children (maximum possible).
Either of the above facts implies that this is a subsequence of A276573.
Indexing starts from zero, because a(0)=0 is a special case in this sequence, as it is only number which is its own child in the least squares beanstalk tree.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10000
FORMULA
a(0) = 0, and for n >= 1, a(n) = A273324(n)^2 - 1.
PROG
(PARI)
\\ (For a more intelligent way to generate the terms, check Altug Alkan's PARI-code for A273324).
istwo(n:int)=my(f); if(n<3, return(n>=0); ); f=factor(n>>valuation(n, 2)); for(i=1, #f[, 1], if(bitand(f[i, 2], 1)==1&&bitand(f[i, 1], 3)==3, return(0))); 1
isthree(n:int)=my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7
A002828(n)=if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))) \\ From _Charles R Greathouse_ IV, Jul 19 2011
i=0; n=0; while(i <= 10000, if(isA278491(n), write("b278491.txt", i, " ", n); i++); n++ );
(Scheme, with Antti Karttunen's IntSeq-library)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 26 2016
STATUS
approved