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.

User: Valtteri Raiko

Valtteri Raiko's wiki page.

Valtteri Raiko has authored 4 sequences.

A256173 Numbers k such that ceiling(sqrt(k))^2 - k is a square.

Original entry on oeis.org

0, 1, 3, 4, 5, 8, 9, 12, 15, 16, 21, 24, 25, 27, 32, 35, 36, 40, 45, 48, 49, 55, 60, 63, 64, 65, 72, 77, 80, 81, 84, 91, 96, 99, 100, 105, 112, 117, 120, 121, 128, 135, 140, 143, 144, 153, 160, 165, 168, 169, 171, 180, 187, 192, 195, 196, 200, 209, 216, 221, 224, 225, 231, 240, 247, 252, 255, 256, 264, 273, 280, 285, 288, 289, 299
Offset: 1

Author

Valtteri Raiko, Mar 17 2015

Keywords

Comments

Numbers k such that A068527(k) is a square. k is in the sequence if and only if k - ceiling(sqrt(k))^2 + ceiling(sqrt(ceiling(sqrt(k))^2 - k))^2 = 0.
A000290 is a subsequence since for a square k, ceiling(sqrt(k))^2 - k = 0, a square too.
Also, numbers k such that A249298(k) is 1.
Also, numbers k such that A249142(k) is 0.
The only prime numbers in the sequence are 3 and 5.
No number from A016825 appears in the sequence.
If p and q are terms of A065091 and if q satisfies the inequality p - 2*sqrt(2p) + 2 < q < p + 2*sqrt(2p) + 2, then p*q is in the sequence. Thus infinitely many numbers from A046315 appear in the sequence.

Examples

			Ceiling(sqrt(27))^2 - 27 = 9 = 3^2, so 27 is in the sequence.
		

Programs

  • Magma
    [n: n in [0..200] | IsSquare(Ceiling(Sqrt(n))^2-n)]; // Vincenzo Librandi, Mar 18 2015
  • Mathematica
    Flatten[Position[Table[n - Ceiling[Sqrt[n]]^2 + Ceiling[Sqrt[-n + Ceiling[Sqrt[n]]^2]]^2, {n, 0, 300}], 0]] - 1
    Select[Range[0,300],IntegerQ[Sqrt[Ceiling[Sqrt[#]]^2-#]]&] (* Harvey P. Dale, Sep 06 2023 *)
  • PARI
    isok(n) = issquare(ceil(sqrt(n))^2-n); \\ Michel Marcus, Mar 18 2015
    

A249298 Smallest positive integer k, such that s-k*n is a square where s is the smallest square >= k*n.

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 3, 1, 1, 4, 5, 1, 5, 6, 1, 1, 9, 2, 9, 2, 1, 12, 13, 1, 1, 14, 1, 3, 17, 2, 19, 1, 3, 20, 1, 1, 23, 24, 3, 1, 25, 2, 27, 6, 1, 30, 31, 1, 1, 2, 3, 7, 35, 4, 1, 2, 3, 40, 41, 1, 41, 42, 1, 1, 1, 4, 47, 10, 5, 2, 51, 1, 51, 52, 3, 12, 1, 6, 57, 1, 1, 60, 61, 1, 3, 62, 7, 3, 65, 2
Offset: 1

Author

Valtteri Raiko, Oct 24 2014

Keywords

Comments

For any n>=3, there exists at least one positive integer k, 1 <= k <= n-1 such that the difference between the smallest square >= k*n and k*n is a square. To prove this, consider the multiplier k = n-2. Then (n-2)*n = (n-1)^2-1, thus the difference from the next square is 1, which is a square. If n = 1, k = 1 and if n = 2, k = 2.
Smallest positive integer k such that ceiling(sqrt(k*n))^2-k*n is a square.

Examples

			a(10) = 4, for ceiling(sqrt(10))^2-10 = 6, ceiling(sqrt(2*10))^2-2*10 = 5, ceiling(sqrt(3*10))^2-3*10 = 6 and ceiling(sqrt(4*10))^2-4*10 = 9 = 3^2.
		

Crossrefs

Cf. A000290, A145236 (equals a(A000040)), A068527 (difference for k=1).

Programs

  • Mathematica
    dif[n_] := Ceiling[Sqrt[n]]^2 - n;a[k_] := Module[{n = 1}, While[dif[dif[n*k]] != 0, n++]; Return[n]];Table[a[k], {k, 1, 90}]
  • PARI
    a(n) = {k=1; while(!issquare(ceil(sqrt(k*n))^2-k*n), k++); k;} \\ Michel Marcus, Oct 24 2014

A249160 Smallest number of iterations k such that A068527^(k)(n)=A068527^(k+1)(n).

Original entry on oeis.org

1, 0, 2, 1, 2, 3, 1, 2, 1, 4, 3, 2, 3, 1, 2, 1, 3, 2, 4, 3, 2, 3, 1, 2, 1, 5, 2, 3, 2, 4, 3, 2, 3, 1, 2, 1, 3, 4, 5, 2, 3, 2, 4, 3, 2, 3, 1, 2, 1, 2, 4, 3, 4, 5, 2, 3, 2, 4, 3, 2, 3, 1, 2, 1, 2, 3, 2, 4, 3, 4, 5, 2, 3, 2, 4, 3, 2, 3, 1, 2, 1, 3, 4, 2, 3, 2, 4, 3, 4, 5, 2, 3, 2, 4, 3, 2, 3, 1, 2, 1
Offset: 1

Author

Valtteri Raiko, Oct 22 2014

Keywords

Comments

Given a number n, denote its distance from next perfect square >= n as R(n), sequence A068527. The function R(n) has two fixed points, 0 and 2, and for all n>=3, R(n)=0, there exists a k>=0 such that R^(k)(n)=R^(k+1)(n)=0 or 2. This sequence gives the number of iterations needed to reach the fixed point starting at n.
This sequence is unbounded, but grows very slowly, reaching records of 1, 2, 3, 4, 6 etc at n=1, 3, 6, 10, 26, 170, 7226, etc.

Examples

			R(10) = 6, R(6) = 3, R(3) = 1, R(1) = 0, R(0) = 0. Thus a(10) = 4.
		

Crossrefs

Cf. A068527.

Programs

  • Maple
    A249160 := proc(n)
        local k,prev,this;
        prev := n ;
        for k from 1 do
            this := A068527(prev) ;
            if this = prev then
                return k-1;
            end if;
            prev := this ;
        end do:
    end proc:
    seq(A249160(n),n=1..80) ; # R. J. Mathar, Nov 17 2014
  • Mathematica
    r[n_]:=Ceiling[Sqrt[n]]^2-n;Table[Length[FixedPointList[r,n]]-2,{n,1,100}]
  • PARI
    r(n)=if(issquare(n),0,(sqrtint(n)+1)^2-n);
    le(n)=b=0;while(n!=0&&n!=2,b=b+1;n=r(n));return(b);
    range(n) = c=List(); for(a = 1, n, listput(c,a)); return(c);
    apply(le, range(100))

A249142 Let k be the difference between the smallest square >= n and n. Sequence gives difference between the smallest square >= k and k.

Original entry on oeis.org

0, 2, 0, 0, 0, 1, 2, 0, 0, 3, 4, 0, 1, 2, 0, 0, 1, 2, 3, 4, 0, 1, 2, 0, 0, 6, 0, 1, 2, 3, 4, 0, 1, 2, 0, 0, 4, 5, 6, 0, 1, 2, 3, 4, 0, 1, 2, 0, 0, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 0, 1, 2, 0, 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 0, 1, 2, 0, 0, 7, 8, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 0, 1, 2, 0, 0
Offset: 1

Author

Valtteri Raiko, Oct 22 2014

Keywords

Comments

Equals A068527 applied to itself.

Examples

			For n = 13 the next biggest square is 16, thus k = 16 - 13 = 3 and for 3 the next biggest square is 4, thus a(14) = 3 - 2 = 1.
		

Crossrefs

Cf. A068527.

Programs

  • Magma
    [n - Ceiling(Sqrt(n))^2 + Ceiling(Sqrt(-n+Ceiling(Sqrt(n))^2))^2: n in [1..100]]; // Vincenzo Librandi, Oct 23 2014
  • Maple
    A068527:= n -> ceil(sqrt(n))^2 - n:
    map(A068527@@2, [$1..100]); # Robert Israel, Nov 02 2017
  • Mathematica
    Table[n - Ceiling[Sqrt[n]]^2 + Ceiling[Sqrt[-n + Ceiling[Sqrt[n]]^2]]^2, {n, 1, 100}]
  • PARI
    A068527(n)=if(issquare(n), 0, (sqrtint(n)+1)^2-n)
    a(n)=A068527(A068527(n)) \\ Charles R Greathouse IV, Oct 22 2014
    

Formula

a(n) = A068527(A068527(n)).
a(n) = n - ceiling(sqrt(n))^2 + ceiling(sqrt(-n+ceiling(sqrt(n))^2))^2.
a(n) < (64n)^(1/4). - Charles R Greathouse IV, Oct 22 2014

Extensions

Edited, old crossrefs entry moved to Comments, and first two formula lines interchanged by Wolfdieter Lang, Nov 10 2014