cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A064672 a(0) = 0, a(1) = 1; for a(n), n >= 2, write n = x^2 + y with y >= 0 as small as possible, then a(n) = a(x) + a(y).

This page as a plain text file.
%I A064672 #18 Oct 07 2017 10:32:20
%S A064672 0,1,2,3,2,3,4,5,4,3,4,5,6,5,6,7,2,3,4,5,4,5,6,7,6,3,4,5,6,5,6,7,8,7,
%T A064672 6,7,4,5,6,7,6,7,8,9,8,7,8,9,10,5,6,7,8,7,8,9,10,9,8,9,10,11,10,11,4,
%U A064672 5,6,7,6,7,8,9,8,7,8,9,10,9,10,11,6,3,4,5,6,5,6,7,8,7,6,7,8,9,8,9,10,5,6
%N A064672 a(0) = 0, a(1) = 1; for a(n), n >= 2, write n = x^2 + y with y >= 0 as small as possible, then a(n) = a(x) + a(y).
%C A064672 Because of the definition of a(n), a(n^2) = a(n) and more generally a(n^(2m)) = a(n), so the sequence recursively contains itself.
%C A064672 a(A064689(n)) = n and a(m) < n for m < A064689(n).
%H A064672 Reinhard Zumkeller, <a href="/A064672/b064672.txt">Table of n, a(n) for n = 0..10000</a>
%F A064672 For n > 1: a(n) = a(A000196(n)) + a(A053186(n)), a(0) = 0, a(1) = 1. [_Reinhard Zumkeller_, Apr 27 2012]
%e A064672 a(7) = 5 because 7 = 2^2 + 3, a(2) = 2 and a(3) = 3, giving 5
%t A064672 a[0]=0; a[1]=1; a[n_] := a[n] = a[ Floor[ Sqrt[n] ] ] + a[ n - Floor[ Sqrt[n] ]^2 ]; Table[a[n], {n, 0, 98}] (* _Jean-François Alcover_, May 23 2012, after _Reinhard Zumkeller_ *)
%o A064672 (Haskell)
%o A064672 a064672 n = a064672_list !! n
%o A064672 a064672_list = 0 : 1 : f (drop 2 a000196_list) 1 1 (tail a064672_list)
%o A064672    where f (r:rs) r' u (v:vs)
%o A064672            | r == r' = (u + v) : f rs r u vs
%o A064672            | r /= r' = u' : f rs r u' (tail a064672_list)
%o A064672            where u' = a064672 $ fromInteger r
%o A064672 -- _Reinhard Zumkeller_, Apr 27 2012
%Y A064672 Cf. A064689.
%Y A064672 Cf. A048760.
%K A064672 nonn,easy,nice
%O A064672 0,3
%A A064672 Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 09 2001