OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
From Robert Israel, Nov 15 2023: (Start)
If n is odd, then a(n) is the least positive integer of the form (k*A019555(n))^3/n - (n-1)/2 where k is an integer.
MAPLE
f:= proc(n) local y, F, t, k, v;
if n::odd then
F:= ifactors(n)[2];
y:= mul(t[1]^ceil(t[2]/3), t=F);
k:= 1+floor((n*(n-1)/2)^(1/3)/y);
(k*y)^3/n - (n-1)/2;
else
v:= padic:-ordp(n, 2);
if v mod 3 <> 1 then return 0 fi;
F:= ifactors(n/2^v)[2];
y:= mul(t[1]^ceil(t[2]/3), t=F)*2^((v-1)/3);
k:= 1 + floor((n*(n-1)/2)^(1/3)/y);
if k::even then k:= k+1 fi;
(k*y)^3/n - (n-1)/2;
fi
end proc:
map(f, [$1..100]); # Robert Israel, Nov 15 2023
MATHEMATICA
f[n_] := Module[{y, F, t, k, v},
If[OddQ[n],
F = FactorInteger[n];
y = Product[t[[1]]^Ceiling[t[[2]]/3], {t, F}];
k = 1 + Floor[(n*(n-1)/2)^(1/3)/y];
(k*y)^3/n - (n-1)/2
,
v = IntegerExponent[n, 2];
If[Mod[v, 3] != 1, Return[0]];
F = FactorInteger[n/2^v];
y = Product[t[[1]]^Ceiling[t[[2]]/3], {t, F}]*2^((v-1)/3);
k = 1 + Floor[(n*(n-1)/2)^(1/3)/y];
If[EvenQ[k], k = k+1];
(k*y)^3/n - (n-1)/2]];
Map[f, Range[100]] (* Jean-François Alcover, Jul 09 2024, after Robert Israel *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Amarnath Murthy, Oct 09 2002
EXTENSIONS
More terms from David Wasserman, Apr 02 2005
STATUS
approved