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.

A309228 a(n) is the greatest possible height of a binary tree where all nodes hold positive squares and all interior nodes also equal the sum of their two children and the root node has value n^2.

This page as a plain text file.
%I A309228 #14 Aug 19 2022 09:26:01
%S A309228 1,1,1,1,2,1,1,1,1,2,1,1,3,1,2,1,3,1,1,2,1,1,1,1,3,3,1,1,3,2,1,1,1,3,
%T A309228 2,1,3,1,3,2,3,1,1,1,2,1,1,1,1,3,3,3,3,1,2,1,1,3,1,2,3,1,1,1,4,1,1,3,
%U A309228 1,2,1,1,3,3,3,1,1,3,1,2,1,3,1,1,4,1,3
%N A309228 a(n) is the greatest possible height of a binary tree where all nodes hold positive squares and all interior nodes also equal the sum of their two children and the root node has value n^2.
%C A309228 The sequence is unbounded and for any k > 0, A309167(k) is the least n such that a(n) = k.
%H A309228 Robert Israel, <a href="/A309228/b309228.txt">Table of n, a(n) for n = 1..10000</a>
%F A309228 a(n) = 1 iff n belongs to A004144.
%F A309228 a(A309167(n)) = n.
%F A309228 If n^2 = u^2 + v^2 with u > v > 0, then a(n) >= 1 + max(a(u), a(v)).
%e A309228 a(1) = 1:
%e A309228               1^2
%e A309228                |
%e A309228 a(5) = 2:
%e A309228            3^2    4^2
%e A309228             \     /
%e A309228              \   /
%e A309228               5^2
%e A309228                |
%e A309228 a(13) = 3:
%e A309228           3^2    4^2
%e A309228            \     /
%e A309228             \   /
%e A309228              5^2    12^2
%e A309228               \      /
%e A309228                \    /
%e A309228                 13^2
%e A309228                   |
%p A309228 f:= proc(n) option remember; local S,x,y;
%p A309228    S:= map(t -> subs(t,[x,y]), {isolve(x^2+y^2=n^2)});
%p A309228    S:= select(t -> type(t,list(posint)) and t[2]>=t[1], S);
%p A309228    if S = {} then 1 else 1+max(map(procname,map(op,S))) fi
%p A309228 end proc:
%p A309228 map(f, [$1..100]); # _Robert Israel_, Feb 27 2022
%t A309228 a = Table[1, {m = 100}];
%t A309228 Do[Do[If[IntegerQ@ Sqrt[v2 = n^2-u^2], a[[n]] = Max[a[[n]], 1+Max[a[[u]], a[[Floor@ Sqrt[v2]]]]]], {u, 1, n-1}], {n, 1, m}];
%t A309228 Table[a[[n]], {n, 1, m}] (* _Jean-François Alcover_, Aug 19 2022, after PARI code *)
%o A309228 (PARI) a = vector(87,n,1); for (n=1, #a, for (u=1, n-1, if (issquare(v2=n^2-u^2), a[n]=max(a[n],1+max(a[u],a[sqrtint(v2)])))); print1 (a[n]", "))
%Y A309228 Cf. A004144, A309167.
%K A309228 nonn
%O A309228 1,5
%A A309228 _Rémy Sigrist_, Jul 16 2019