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.

Showing 1-4 of 4 results.

A347594 a(0) = 1; for n>0, a(n) is the smallest positive integer such that a(n-1)^2 + n^2 + a(n) is a square.

Original entry on oeis.org

1, 2, 1, 6, 12, 27, 19, 31, 64, 48, 96, 72, 1, 26, 28, 15, 3, 26, 24, 24, 48, 64, 44, 35, 48, 96, 108, 151, 131, 223, 447, 831, 639, 190, 380, 299, 507, 663, 1212, 904, 209, 7, 36, 104, 17, 87, 116, 211, 264, 264, 165, 103, 143, 151, 204, 303, 536, 1055, 860, 1688, 3156, 2592, 1341, 1399
Offset: 0

Views

Author

Scott R. Shannon, Sep 08 2021

Keywords

Comments

In the first one million terms the largest value is a(987016) = 123592518669. In this range the smallest number that has not yet appeared is 9.

Examples

			a(1) = 2 as a(0)^2 + 1^2 = 1 + 1 = 2, and 2 + 2 = 4 = 2^2 is the next smallest square.
a(2) = 1 as a(1)^2 + 2^2 = 4 + 4 = 8, and 8 + 1 = 9 = 3^2 is the next smallest square.
a(60) = 3156 as a(59)^2 + 60^2 = 2849344 + 3600 = 2852944, and 2852944 + 3156 = 2856100 = 1690^2 is the next smallest square.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1, m = Last[#1]}, While[! IntegerQ@ Sqrt[#2^2 + m^2 + k], k++]; k]] & @@ {#, Length@ #} &, {1}, 63] (* Michael De Vlieger, Sep 08 2021 *)
  • PARI
    lista(nn) = {my(prec = 1, list=List()); listput(list, prec); for (n=1, nn, my(k = 1); while (!issquare(prec^2+n^2+k), k++); listput(list, k); prec = k;); Vec(list);} \\ Michel Marcus, Sep 13 2021
  • Python
    from math import isqrt
    A347594_list = [1]
    for n in range(1,10**3):
        m = A347594_list[n-1]**2+n**2
        A347594_list.append((isqrt(m)+1)**2-m) # Chai Wah Wu, Sep 12 2021
    

A347595 a(0) = 1; for n>0, a(n) is the smallest positive integer that has not previously occurred such that a(n-1)^2 + n^2 + a(n) is a square.

Original entry on oeis.org

1, 2, 8, 27, 39, 54, 73, 98, 133, 186, 273, 426, 709, 1250, 2305, 4386, 8517, 16746, 33169, 65978, 131557, 262674, 524865, 1049202, 2097829, 4195034, 8389393, 16778058, 33555333, 67109826, 134218753, 268436546, 536872069, 1073743050, 2147484945, 4294968666, 8589936037, 17179870706
Offset: 0

Views

Author

Scott R. Shannon, Sep 08 2021

Keywords

Comments

This sequence uses the same rules as A347594 except here all numbers must be unique. Up to 10^5 terms all terms are larger than the previous term; it is unknown if this holds for all terms as n->infinity.

Examples

			a(1) = 2 as a(0)^2 + 1^2 = 1 + 1 = 2, and 2 + 2 = 4 = 2^2 is the next smallest square.
a(2) = 8 as a(1)^2 + 2^2 = 4 + 4 = 8, and 8 + 8 = 16 = 4^2. Note that although 8 + 1 = 9 = 3^2, 1 cannot be chosen as a(0) = 1.
a(3) = 27 as a(2)^2 + 3^2 = 64 + 9 = 73 and 73 + 27 = 100 = 10^2.  Note that although 73 + 8 = 81 = 9^2, 8 cannot be chosen as a(2) = 8.
a(4) = 39 as a(3)^2 + 4^2 = 729 + 16 = 745, and 745 + 39 = 784 = 28^2 is the next smallest square.
		

Crossrefs

A349119 a(0) = 1; for n>0, a(n) is the smallest positive integer that has not previously occurred such that |n - a(n-1)| + a(n) is a square.

Original entry on oeis.org

1, 4, 2, 3, 8, 6, 9, 7, 15, 10, 16, 11, 24, 5, 27, 13, 22, 20, 14, 31, 25, 12, 26, 33, 40, 21, 44, 19, 55, 23, 18, 36, 32, 35, 48, 51, 34, 46, 17, 42, 47, 30, 37, 43, 63, 82, 28, 45, 61, 52, 62, 38, 50, 78, 57, 79, 41, 65, 29, 70, 39, 59, 97, 66, 98, 67, 80, 68, 49, 101, 69, 119, 53, 124, 71, 60
Offset: 0

Views

Author

Scott R. Shannon, Nov 08 2021

Keywords

Examples

			a(1) = 4 as |1 - a(0)| = |1 - 1| = 0, and 0 + 4 = 4 = 2^2 is the next smallest square. Note a(1) cannot be 1 as a(0) = 1.
a(4) = 8 as |4 - a(3)| = |4 - 3| = 1, and 1 + 8 = 9 = 3^2 is the next smallest square. Note a(4) cannot be 3 as a(3) = 3.
a(8) = 15 as |8 - a(7)| = |8 - 7| = 1, and 1 + 15 = 16 = 4^2 is the next smallest square. Note a(8) cannot be 3 or 8 as these have previously occurred.
		

Crossrefs

A349182 a(0) = 1; for n>0, a(n) is the smallest positive integer such that |n - a(n-1)| + a(n) is a square.

Original entry on oeis.org

1, 1, 3, 1, 1, 5, 3, 5, 1, 1, 7, 5, 2, 5, 7, 1, 1, 9, 7, 4, 9, 4, 7, 9, 1, 1, 11, 9, 6, 2, 8, 2, 6, 9, 11, 1, 1, 13, 11, 8, 4, 12, 6, 12, 4, 8, 11, 13, 1, 1, 15, 13, 10, 6, 1, 10, 3, 10, 1, 6, 10, 13, 15, 1, 1, 17, 15, 12, 8, 3, 14, 7, 16, 7, 14, 3, 8, 12, 15, 17, 1, 1, 19, 17, 14, 10, 5, 18, 11
Offset: 0

Views

Author

Scott R. Shannon, Nov 09 2021

Keywords

Examples

			a(1) = 1 as |1 - a(0)| = |1 - 1| = 0, and 0 + 1 = 1 = 1^2 is the next smallest square.
a(2) = 3 as |2 - a(1)| = |2 - 1| = 1, and 1 + 3 = 4 = 2^2 is the next smallest square.
a(5) = 5 as |5 - a(4)| = |5 - 1| = 4, and 4 + 5 = 9 = 3^2 is the next smallest square.
		

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,Module[{k=1},While[!IntegerQ[Sqrt[(Abs[n+1-a])+k]],k++];k]}; NestList[ nxt,{0,1},90][[;;,2]] (* Harvey P. Dale, Aug 20 2024 *)
Showing 1-4 of 4 results.