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.
%I A228564 #77 Aug 04 2025 11:21:33 %S A228564 1,1,5,5,17,13,37,25,65,41,101,61,145,85,197,113,257,145,325,181,401, %T A228564 221,485,265,577,313,677,365,785,421,901,481,1025,545,1157,613,1297, %U A228564 685,1445,761,1601,841,1765,925,1937,1013,2117,1105,2305,1201,2501,1301,2705 %N A228564 Largest odd divisor of n^2 + 1. %C A228564 From _Lamine Ngom_, Jan 04 2023: (Start) %C A228564 For n>2, a(n) = hypotenuse c of the primitive Pythagorean triple (a, b, c) such that n*a = b + c. %C A228564 Terms that appear twice (1, 5, 145, 4901, ...) are the positive terms of A076218. Equivalently, the products of two consecutive terms of A001653, or one more than the squares of A001542. %C A228564 These duplicated terms appear at indices i and j (i>j) such that (i^2-1)/2 = j^2 (A001541). In addition, they are hypotenuse in two primitive Pythagorean triples: (i, j^2, a(i)) and (2*j, j^2-1, a(i)). (End) %H A228564 Jeremy Gardiner, <a href="/A228564/b228564.txt">Table of n, a(n) for n = 0..1000</a> %H A228564 Wikipedia, <a href="https://en.wikipedia.org/wiki/Quasi-polynomial">Quasi-polynomial</a>. %H A228564 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-3,0,1). %F A228564 a(n) = A000265(A002522(n)). %F A228564 From _Ralf Stephan_, Aug 26 2013: (Start) %F A228564 a(4n) = 4*a(2n) - 3. %F A228564 a(4n+1) = 2*a(2n) + 4*n - 1. %F A228564 a(4n+2) = 4*a(2n) + 16*n + 1. %F A228564 a(4n+3) = 2*a(2n) + 12*n + 3. (End) %F A228564 From _Bruno Berselli_, Aug 26 2013: (Start) %F A228564 G.f.: (1 + x + 2*x^2 + 2*x^3 + 5*x^4 + x^5) / (1-x^2)^3. %F A228564 a(n) = 3*a(n-2) -3*a(n-4) +a(n-6). %F A228564 a(n) = (n^2+1)*(3+(-1)^n)/4. (End) %F A228564 From _Peter Bala_, Feb 14 2019: (Start) %F A228564 a(n) = numerator((n^2 + 1)/(n + 1)). %F A228564 a(n) is a quasi-polynomial in n: a(2*n) = 4*n^2 + 1; a(2*n + 1) = 2*n^2 + 2*n + 1. (End) %F A228564 From _Amiram Eldar_, Aug 09 2022: (Start) %F A228564 a(n) = numerator((n^2+1)/2). %F A228564 Sum_{n>=0} 1/a(n) = (1 + coth(Pi/2)*Pi/2 + tanh(Pi/2)*Pi)/2. (End) %F A228564 E.g.f.: ((2 + x + 2*x^2)*cosh(x) + (1 + x)^2*sinh(x))/2. - _Stefano Spezia_, Aug 04 2025 %e A228564 A002522(3) = 3^2+1 = 10 => a(3) = 10/2 = 5. %p A228564 lod:= t -> t/2^padic:-ordp(t,2): %p A228564 seq(lod(n^2+1),n=0..60); # _Robert Israel_, Aug 19 2014 %t A228564 Table[(n^2 + 1) (3 + (-1)^n)/4, {n, 0, 60}] (* _Bruno Berselli_, Aug 26 2013 *) %o A228564 (BASIC) %o A228564 for n = 0 to 45 : t=n^2+1 %o A228564 x: if not t mod 2 then t=t/2 : goto x %o A228564 print str$(t);", "; : next n %o A228564 print %o A228564 end %o A228564 (PARI) a(n)=if(n<2,n>0,m=n\4;[4*a(2*m)-3,2*a(2*m)+4*m-1,4*a(2*m)+16*m+1,2*a(2*m)+12*m+3][(n%4)+1]) \\ _Ralf Stephan_, Aug 26 2013 %o A228564 (PARI) a(n)=(n^2+1)/2^valuation(n^2+1,2) \\ _Ralf Stephan_, Aug 26 2013 %o A228564 (Magma) [(n^2+1)*(3+(-1)^n)/4: n in [0..60]]; // _Bruno Berselli_, Aug 26 2013 %o A228564 (Magma) [Denominator(2*n^2/(n^2+1)): n in [0..60]]; // _Vincenzo Librandi_, Aug 19 2014 %o A228564 (GAP) List([0..60],n->NumeratorRat((n^2+1)/(n+1))); # _Muniru A Asiru_, Feb 20 2019 %o A228564 (Sage) [(n^2+1)*(3+(-1)^n)/4 for n in (0..60)] # _G. C. Greubel_, Feb 20 2019 %Y A228564 Cf. A000265, A002522, A164900, A191871. %K A228564 nonn,easy %O A228564 0,3 %A A228564 _Jeremy Gardiner_, Aug 25 2013