OFFSET
1,1
LINKS
Enoch Haga, Problem, School Science and Mathematics, Nov 1983, vol. 83, no 7, page 628.
Sean A. Irvine, Java program (github)
LaBar, Problem #3929, School Science and Mathematics, Dec 1982, vol. 82 no 8, page 715.
EXAMPLE
Beginning at n=1, algorithm produces s+t+a=18.
PROG
(This was in the formula section but is clearly a program in some language. - N. J. A. Sloane, Apr 18 2017)
f=1\n=n+1:a=n\x=n/3\ (Case 1) if int(x)=x then o=o+1:n=x:s=s+n: if n=1 then print s+t+a:e=0:o=0:s=0:t=0:n=a:return to n=n+1\if n<>1 then return to x=n/3\ (Case 2) if int(x)<>x then e=e+1\if f=1 then y=n*2+2:f=0:n=y:t=t+n:else y=n*2+1:f=1\n=y:t=t+n\if n=1 then print s+t+a:return to n=n+1:else return to x=n/3
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
STATUS
approved