OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = (A172126(n) - 1)/3. This can be shown by directly deriving the formula in the sequence definition from Collatz rules, by asking, when is (4^{k+1} - 1)/3 * 2^l congruent 1 mod 3? - Ralf Stephan, Dec 18 2025
MATHEMATICA
seq[max_] := Module[{kmax = Floor[Log[4, 3*max+1]], s = {}, s1, odd}, Do[odd = (4^k-1)/3; s1 = 2^Range[0, Floor[Log2[max/odd]]] * odd; s = Join[s, s1], {k, 1, kmax}]; Select[(Union[s] - 1)/3, IntegerQ]]; seq[10^7] (* Amiram Eldar, Sep 01 2024 *)
PROG
(PARI) for(n=1, 2000000, my(o=3*n/2^valuation(n, 2)+1, b=ispower(o)); if(b&&b%2==0&&round(sqrtn(o, b/2))==4&&(n-1)%3==0, print1((n-1)/3, ", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Nov 19 2010
EXTENSIONS
More terms from Amiram Eldar, Sep 01 2024
Definition changed by Ralf Stephan, Dec 18 2025
STATUS
approved
