%I #16 Apr 19 2019 11:12:05
%S 1,2,3,5,7,10,11,13,17,19,21,23,29,31,37,41,43,47,50,53,55,59,61,67,
%T 71,73,79,83,89,91,97,98,101,103,107,109,113,127,131,137,139,147,149,
%U 151,154,157,163,167,173,179,181,187,191,193,197,199,211,223,227,229,233,239,241,247,251,257,263,266,269,271,277,281,283,293,307
%N Numbers n for which A156552(n) is a square or a twice a square.
%C Union of {1} and sequence A005940(1+A028982(n)), n >= 1, sorted into ascending order.
%C After the initial 1, gives the positions of ones in A324885.
%H Antti Karttunen, <a href="/A324813/b324813.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%t Select[Range@ 320, AnyTrue[{#, #/2}, IntegerQ@ Sqrt@ # &] &@ Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ #]] &] (* _Michael De Vlieger_, Mar 27 2019 *)
%o (PARI)
%o A156552(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552 by _David A. Corneth_
%o A324823(n) = if(1==n,0, n=A156552(n); (issquare(n) || (!(n%2) && issquare(n/2))));
%o for(n=1, oo, if((1==n)||A324823(n), print1(n, ", ")));
%o (PARI) is(n) = { n = A156552(n); n == 0 || n >>= (valuation(n, 2)%2); issquare(n); }; \\ _David A. Corneth_, Mar 16 2019
%Y Cf. A005940, A028982, A156552, A324823 (characteristic function for terms > 1), A324825, A324885.
%Y Cf. A000040, A324812 (subsequences), A324814.
%K nonn,base
%O 1,2
%A _Antti Karttunen_, Mar 16 2019