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.

A240952 Smallest number that can be written in exactly n ways as sum of two quarter-squares.

Original entry on oeis.org

19, 0, 1, 2, 6, 18, 36, 72, 106, 450, 562, 2312, 1156, 9522, 1381, 8712, 4930, 16562, 13812, 35912, 14862, 233928, 53316, 361250, 40056, 211250, 55981, 1678112, 51106, 1216800, 305256, 610512, 255531
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 04 2014

Keywords

Comments

A245575(a(n)) = n and A245575(a(m)) <> n for m < a(n).

Examples

			a(0) = A245585(1) = 19, A245575(19) = 0;
a(1) =  0: A245575(0) =  #{0+0} = 1;
a(2) =  1: A245575(1) =  #{1+0, 0+1} = 2;
a(3) =  2: A245575(2) =  #{2+0, 1+1, 0+2} = 3;
a(4) =  6: A245575(6) =  #{6+0, 4+2, 2+4, 0+6} = 4;
a(5) = 18: A245575(18) = #{16+2, 12+6, 9+9, 6+12, 2+16} = 5;
a(6) = 36: A245575(36) = #{36+0, 30+6, 20+16, 16+20, 6+30, 0+36} = 6.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a240952 = fromJust . (`elemIndex` a245575_list)
  • Mathematica
    nmax = 36000;
    qsQ[n_] := qsQ[n] = With[{s = Sqrt[n]}, Which[IntegerQ[s], True, n == Floor[s] (Floor[s]+1), True, True, False]];
    A245575[n_] := Count[Range[0, n], k_ /; qsQ[k] && qsQ[n-k]];
    Table[{A245575[n], n}, {n, 0, nmax}] // Sort // SplitBy[#, First]& // #[[All, 1, 2]]& (* Jean-François Alcover, May 08 2017 *)

Extensions

a(21)-a(32) from Jinyuan Wang, Jul 08 2021