%I #17 Feb 23 2025 14:43:09
%S 0,3,24,35,99,120,195,323,440,483,675,728,899,1155,1368,1443,1763,
%T 1848,2115,2499,2808,2915,3363,3480,3843,4355,4760,4899,5475,5624,
%U 6083,6723,7224,7395,8099,8280,8835,9603,10200,10403,11235,11448,12099,12995,13688,13923,14883,15128,15875,16899,17688,17955,19043,19320,20163
%N After a(0)=0, numbers n such that (A002828(1+n) = 1) and (A002828(4+n) = 4).
%C 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).
%C Because A002828 obtains value 1 only at squares, every term must be one less than a square.
%C 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).
%C Either of the above facts implies that this is a subsequence of A276573.
%C 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.
%H Antti Karttunen, <a href="/A278491/b278491.txt">Table of n, a(n) for n = 0..10000</a>
%F a(0) = 0, and for n >= 1, a(n) = A273324(n)^2 - 1.
%o (PARI)
%o \\ (For a more intelligent way to generate the terms, check _Altug Alkan_'s PARI-code for A273324).
%o 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
%o isthree(n:int)=my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7
%o A002828(n)=if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))) \\ From _Charles R Greathouse_ IV, Jul 19 2011
%o isA278491(n) = (!n || ((A002828(1+n) == 1) && (A002828(4+n) == 4)));
%o i=0; n=0; while(i <= 10000, if(isA278491(n), write("b278491.txt", i, " ", n); i++); n++ );
%o (Scheme)
%o ;; With _Antti Karttunen_'s IntSeq-library.
%o (define A278491 (MATCHING-POS 0 0 (lambda (n) (= 4 (A278216 n)))))
%Y Cf. A002828, A273324, A278216.
%Y Subsequence of A005563, A276573 and A278489.
%K nonn
%O 0,2
%A _Antti Karttunen_, Nov 26 2016