OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..2100
MAPLE
f:= proc(a, b)
local s;
s:= map(t -> rhs(op(t)), [msolve(x^2=1, 8*a)]);
min(select(`>`, map(t -> (t^2-1)/(8*a), s), b))
end proc:
A[0]:= 1: A[1]:= 1:
for nn from 2 to 100 do
A[nn]:= f(A[nn-2], A[nn-1])
od:
seq(A[i], i=0..100); # Robert Israel, Jun 17 2020
MATHEMATICA
a[0]=a[1]=1; a[n_]:=a[n]=(k=a[n-1]+1; While[!IntegerQ@Sqrt[1+8*a[n-2]k], k++]; k); Array[a, 50, 0] (* Giorgos Kalogeropoulos, May 21 2021 *)
lktn[{a_, b_}]:=Module[{k=b+1}, While[!OddQ[Sqrt[8a k+1]], k++]; {b, k}]; NestList[lktn, {1, 1}, 50][[;; , 1]] (* Harvey P. Dale, Sep 09 2023 *)
PROG
(Python)
prpr = prev = 1
for n in range(1, 55):
print prpr,
b = k = 0
while k<=prev:
d = b*(b+1)/2
k = 0
if d%prpr==0:
k = d / prpr
b += 1
prpr = prev
prev = k
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Aug 03 2012
STATUS
approved