OFFSET
1,1
COMMENTS
From Robert Israel, Jun 26 2018: (Start)
a(n) = 3*n*(n-1)/2 if n is an odd prime power.
a(2^k) = 4^(k+1) - 2^(k+1). (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 5 + 6 + 7 + 8 + 9 + 10 + 11 = 56; A081467(4) = 11.
MAPLE
f:= proc(n) local k;
k:= min(map(t ->rhs(op(t)), {msolve(k*(k+1), 2*n)}) minus {0});
k*n+k*(k+1)/2
end proc:
f(1):= 2:
map(f, [$1..100]); # Robert Israel, Jun 26 2018
MATHEMATICA
a[n_] := For[k = 1, True, k++, If[Divisible[m = k n + k(k+1)/2, n], Return[m] ] ]; Array[a, 100] (* Jean-François Alcover, Mar 25 2019 *)
PROG
(PARI) a(n) = {my(k = 1); while((s=k*n + k*(k+1)/2) % n, k++); s; } \\ Michel Marcus, Jul 29 2017
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Amarnath Murthy, Mar 23 2003
EXTENSIONS
More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 06 2003
STATUS
approved