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.

A261604 a(1)=0. For n>1, a(n) = smallest number > a(n-1) such that, for all m,r a(n) != a(m)^2 + a(r)^2.

This page as a plain text file.
%I A261604 #26 Sep 01 2015 16:57:26
%S A261604 0,1,3,4,5,6,7,8,11,12,13,14,15,19,20,21,22,23,24,27,28,29,30,31,33,
%T A261604 35,38,39,40,42,43,44,46,47,48,51,53,54,55,56,57,59,60,62,63,66,67,68,
%U A261604 69,70,71,75,76,77,78,79,81,82,83,84,86,87,88
%N A261604 a(1)=0. For n>1, a(n) = smallest number > a(n-1) such that, for all m,r<n, a(n) != a(m)^2 + a(r)^2.
%H A261604 Charles R Greathouse IV, <a href="/A261604/b261604.txt">Table of n, a(n) for n = 1..10000</a>
%H A261604 Anders Hellström, <a href="/A261604/a261604_1.rb.txt">Ruby program</a>
%F A261604 a(n) ~ n, and in particular a(n) = n + O(n/sqrt(log n)). I do not know if this bound is tight. - _Charles R Greathouse IV_, Sep 01 2015
%o A261604 (PARI) issumsq(n,r,s)=(r^2)+(s^2)==n
%o A261604 first(m)=my(v=vector(m), x, r, n, s); v[1]=0; for(n=2, m, v[n]=v[n-1]+1;until(x==1, for(r=1, n-1, for(s=1, n-1, if(issumsq(v[n],v[r],v[s]), v[n]++; x=0; break(2), x=1))))); v;
%o A261604 (PARI) isA022544(n)=if(n%4==3, return(1)); my(f=factor(n)); for(i=1,#f~, if(f[i,1]%4==3 && f[i,2]%2, return(1))); 0
%o A261604 search(v,x)=my(t=setsearch(v,x)); if(t, t, setsearch(v,x,1))
%o A261604 list(lim)=my(v=List([0,1]),t); for(n=3,lim, if(isA022544(n), listput(v,n); next); for(j=search(v,sqrtint((n-1)\2)+1),search(v,sqrtint(n)), if(issquare(n-v[j]^2, &t) && setsearch(v,t), next(2))); listput(v,n)); Set(v) \\ _Charles R Greathouse IV_, Sep 01 2015
%Y A261604 A022544 is a subsequence.
%Y A261604 Cf. A026468, A026466, A026467, A026469, A026470.
%K A261604 nonn
%O A261604 1,3
%A A261604 _Anders Hellström_, Aug 25 2015