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.

Previous Showing 21-30 of 46 results. Next

A056895 If the smallest prime with a square excess of n is p then a(n)^2 = p - n.

Original entry on oeis.org

1, 1, 2, 3, 6, 5, 4, 9, 8, 7, 6, 7, 10, 15, 8, 9, 24, 11, 12, 21, 16, 13, 12, 13, 16, 15, 14, 17, 18, 31, 20, 27, 20, 23, 18, 19, 22, 21, 20, 23, 24, 23, 24, 27, 28, 29, 30, 25, 38, 39, 26, 31, 30, 35, 28, 45, 34, 31, 42, 31, 34, 33, 32, 33, 36, 35, 34, 75, 40, 37, 36, 41, 48, 45
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(4)=3 because the smallest prime with a square excess of 4 is 13 and 13 - 4 = 3^2.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[p = 2; While[n != p - (r = Floor@Sqrt[p])^2, p = NextPrime[p]]; AppendTo[a, r], {n, 74}]; a (* Ivan Neretin, May 02 2019 *)
  • PARI
    a(n) = {my(p=2); while(n != p-sqrtint(p)^2, p = nextprime(p+1)); sqrtint(p - n);} \\ Michel Marcus, May 05 2019

Formula

a(n) = sqrt(A056893(n)-n) = A000196(A056893(n)) = sqrt(A056894(n)).

A094761 a(n) = n + (square excess of n).

Original entry on oeis.org

0, 1, 3, 5, 4, 6, 8, 10, 12, 9, 11, 13, 15, 17, 19, 21, 16, 18, 20, 22, 24, 26, 28, 30, 32, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 64, 66, 68, 70, 72, 74, 76, 78
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Comments

The trajectory of n under iteration of m -> a(m) is eventually constant iff n is a perfect square.
Conjecture (verified up to 727): the numbers not in this sequence are those of A008865. - R. J. Mathar, Jan 23 2009
From Maon Wenders, Jul 01 2012: (Start)
Proof of conjecture:
(1) (n+2)^2 - n^2 = n^2 + 4n + 4 - n^2 = 4n + 4
(2) (n+1)^2 - n^2 = n^2 + 2n + 1 - n^2 = 2n + 1
(3) (n+1) + square excess of (n+1) - (n + square excess of n) = 2, except when (n+1) is a square, where a(n) collapses back to (n+1)
(4) so, cause of (2) and (3), the sequence has blocks of even and odd numbers starting with an even or odd square, m^2 and of length 2m+1:
0,
1, 3, 5,
4, 6, 8, 10, 12,
9, 11, 13, 15, 17, 19, 21,
16, 18, 20, 22, 24, 26, 28, 30, 32,
...
(5) such a block of 2m+1 numbers fills in all even or odd numbers between
n^2 and (n+2)^2
(6) but, because a block starts n^2 + 0, n^2 + 2, n^2 + 4, ..., the last number in such a block is n^2 + 2*(2n+1-1) = n^2 + 4n
(7) so the numbers n^2 + 4n + 2 = (n+2)^2 - 2 are missing.
End of proof. (End)

Crossrefs

Programs

Formula

a(n) = n + A053186(n).

A094763 Trajectory of 2 under repeated application of the map n -> n + square excess of n.

Original entry on oeis.org

2, 3, 5, 6, 8, 12, 15, 21, 26, 27, 29, 33, 41, 46, 56, 63, 77, 90, 99, 117, 134, 147, 150, 156, 168, 192, 215, 234, 243, 261, 266, 276, 296, 303, 317, 345, 366, 371, 381, 401, 402, 404, 408, 416, 432, 464, 487, 490, 496, 508, 532, 535, 541, 553, 577, 578, 580, 584, 592, 608
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Crossrefs

Programs

  • Maple
    a[0]:= 2:
    for n from 1 to 100 do a[n]:= f(a[n-1]) od:
    seq(a[n],n=0..100); # Robert Israel, Jan 28 2018
  • PARI
    lista(nn) = {print1(n=2, ", "); for (k=2, nn, m = 2*n - sqrtint(n)^2; print1(m, ", "); n = m;);} \\ Michel Marcus, Oct 23 2015

A176035 Difference between product of two distinct primes and previous perfect square.

Original entry on oeis.org

2, 1, 5, 6, 5, 6, 1, 8, 9, 10, 2, 3, 10, 2, 6, 8, 9, 13, 1, 5, 10, 13, 1, 4, 5, 6, 10, 12, 13, 14, 6, 11, 15, 18, 19, 1, 2, 8, 12, 13, 20, 21, 22, 1, 2, 11, 14, 15, 17, 22, 8, 9, 14, 16, 18, 25, 5, 6, 7, 9, 10, 13, 17, 18, 19, 21, 22, 23, 25, 1, 10, 12, 22, 24, 28, 29, 3, 6, 9, 11, 18, 22, 31
Offset: 1

Views

Author

Keywords

Comments

6-4=2, 10-9=1, 14-9=5, 15-9=6, 21-16=5,..

Crossrefs

Programs

Formula

a(n) = A053186(A006881(n)). - R. J. Mathar, Aug 25 2025

A262678 a(n) = n - A262690(n), where A262690(n) = largest square k <= n such that A002828(n-k) = A002828(n)-1.

Original entry on oeis.org

0, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 8, 4, 5, 6, 0, 1, 9, 10, 4, 5, 13, 14, 8, 0, 1, 2, 3, 4, 5, 6, 16, 8, 9, 10, 0, 1, 2, 3, 4, 16, 17, 18, 8, 9, 10, 11, 32, 0, 1, 2, 16, 4, 5, 6, 20, 8, 9, 10, 11, 25, 13, 14, 0, 1, 2, 18, 4, 5, 34, 22, 36, 9, 25, 26, 40, 13, 29, 30, 16, 0, 1, 2, 20, 4, 5, 6, 52, 25, 9, 10, 11, 29, 13, 14, 32, 16, 49, 18, 0
Offset: 0

Views

Author

Antti Karttunen, Oct 03 2015

Keywords

Crossrefs

Cf. also A053186.

Programs

Formula

a(n) = n - A262690(n).

A288969 Triangular array read by rows: row n is the list of the 2*n-1 successive values taken by the function z = n - floor(x) * floor(y) along the hyperbola with equation y = n/x, for 1 <= x <= n.

Original entry on oeis.org

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

Views

Author

Luc Rousseau, Jun 20 2017

Keywords

Comments

See A288966's links for explanations about the algorithm used to go along an hyperbola of equation y = n/x, with 1 <= x <= n.
When represented as a triangular array, internal zeros "0" correspond to factorizations of n.
This array appears to resemble a version of the sieve of Eratosthenes with zeros aligned.
A053186 and A293497 appear to intertwine into this sequence. The following will be denoted "assumption (1)": with t indexing columns, t=0 being central: T(n, 2k) = A053186(n+k^2) and T(n, 2k+1) = A293497(n+k(k+1)). - Luc Rousseau, Oct 11 2017
It would be nice to have a larger b-file, or an a-file. - N. J. A. Sloane, Oct 13 2017

Examples

			Array begins:
                0
              0 1 0
            0 1 2 1 0
          0 1 2 0 2 1 0
        0 1 2 3 1 3 2 1 0
      0 1 2 3 0 2 0 3 2 1 0
    0 1 2 3 4 1 3 1 4 3 2 1 0
  0 1 2 3 4 0 2 4 2 0 4 3 2 1 0
		

Crossrefs

Programs

  • Java
    package oeis;
    public class B {
    public static void main(String[] args) {
    for (int n = 1; n <= 8; n ++) {
    hyberbolaTiles(n);
    }
    }
    private static void hyberbolaTiles(int n) {
    int x = 0, y = 0, p = 0, q = n;
    do {
    if (p != 0) {
    System.out.println(n - p * q);
    }
    if (y < 0) { x = y + q; q --; }
    if (y > 0) { p ++; x = y - p; }
    if (y == 0) {
    p ++;
    x = 0; System.out.println("0");
    q --;
    }
    y = x + p - q;
    } while (q > 0);
    }
    }
    
  • Mathematica
    (* Under assumption (1) *)
    A288969[n_, t_] := Module[{x},
      x = Floor[(-t + Sqrt[t^2 + 4 n])/2];
      n - x (t + x)
    ] (* Luc Rousseau, Oct 11 2017 *)
    (* or *)
    FEven[x_] := x^ 2
    InvFEven[x_] := Sqrt[x]
    GEven[n_] := n - FEven[Floor[InvFEven[n]]]
    FOdd[x_] := x*(x + 1)
    InvFOdd[x_] := (Sqrt[1 + 4 x] - 1)/2
    GOdd[n_] := n - FOdd[Floor[InvFOdd[n]]]
    A288969[n_, t_] := Module[
      {e, k, x},
      e = EvenQ[t];
      k = If[e, t/2, (t - 1)/2];
      x = n + If[e, FEven[k], FOdd[k]];
      If[e, GEven[x], GOdd[x]]
    ] (* Luc Rousseau, Oct 11 2017 *)
  • PARI
    htrow(n) = {my(x = 0, y = 0, p = 0, q = n); while (q>0, if (p, print1(n-p*q, ", ")); if (y < 0, x = y + q; q --); if (y > 0, p ++; x = y - p); if (y == 0, p++; x = 0; print1(0, ", "); q --;); y = x + p - q;);}
    tabf(nn) = for (n=1, nn, htrow(n); print()); \\ Michel Marcus, Jun 21 2017

Formula

From Luc Rousseau, Oct 11 2017: (Start)
(All formulas under assumption (1))
With t indexing columns, t=0 being central,
T(n, 2k) = A053186(n+k^2).
T(n, 2k+1) = A293497(n+k(k+1)).
T(n, t) = n - x*(x+t) where x = floor((-t+sqrt(t^2+4n))/2).
With A293578 viewed as a 2D array T',
T'(n,t)=T(n-1,t)-T(n,t)+1 (define T(0,0) as 0).
(End)

Extensions

More terms from Michel Marcus, Jun 21 2017

A061887 n + largest square less than or equal to n; numbers in the range [2k^2,2k^2+2k] for some k.

Original entry on oeis.org

0, 2, 3, 4, 8, 9, 10, 11, 12, 18, 19, 20, 21, 22, 23, 24, 32, 33, 34, 35, 36, 37, 38, 39, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 128, 129
Offset: 0

Views

Author

Henry Bottomley, May 12 2001

Keywords

Examples

			a(15)=15+9=24; a(16)=16+16=32; a(17)=17+16=33.
		

Crossrefs

Programs

  • Mathematica
    Table[n+Floor[Sqrt[n]]^2,{n,0,70}] (* Harvey P. Dale, Aug 23 2012 *)

Formula

a(n) = n+[sqrt(n)]^2 = n+A048760(n) = 2n-A053186(n).

A064672 a(0) = 0, a(1) = 1; for a(n), n >= 2, write n = x^2 + y with y >= 0 as small as possible, then a(n) = a(x) + a(y).

Original entry on oeis.org

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

Views

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 09 2001

Keywords

Comments

Because of the definition of a(n), a(n^2) = a(n) and more generally a(n^(2m)) = a(n), so the sequence recursively contains itself.
a(A064689(n)) = n and a(m) < n for m < A064689(n).

Examples

			a(7) = 5 because 7 = 2^2 + 3, a(2) = 2 and a(3) = 3, giving 5
		

Crossrefs

Cf. A064689.
Cf. A048760.

Programs

  • Haskell
    a064672 n = a064672_list !! n
    a064672_list = 0 : 1 : f (drop 2 a000196_list) 1 1 (tail a064672_list)
       where f (r:rs) r' u (v:vs)
               | r == r' = (u + v) : f rs r u vs
               | r /= r' = u' : f rs r u' (tail a064672_list)
               where u' = a064672 $ fromInteger r
    -- Reinhard Zumkeller, Apr 27 2012
  • Mathematica
    a[0]=0; a[1]=1; a[n_] := a[n] = a[ Floor[ Sqrt[n] ] ] + a[ n - Floor[ Sqrt[n] ]^2 ]; Table[a[n], {n, 0, 98}] (* Jean-François Alcover, May 23 2012, after Reinhard Zumkeller *)

Formula

For n > 1: a(n) = a(A000196(n)) + a(A053186(n)), a(0) = 0, a(1) = 1. [Reinhard Zumkeller, Apr 27 2012]

A094764 Trajectory of 7 under repeated application of the map n --> n + square excess of n.

Original entry on oeis.org

7, 10, 11, 13, 17, 18, 20, 24, 32, 39, 42, 48, 60, 71, 78, 92, 103, 106, 112, 124, 127, 133, 145, 146, 148, 152, 160, 176, 183, 197, 198, 200, 204, 212, 228, 231, 237, 249, 273, 290, 291, 293, 297, 305, 321, 353, 382, 403, 406, 412, 424, 448, 455, 469, 497, 510, 536, 543
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

References

  • H. Brocard, Note 2837, L'Intermédiaire des Mathématiciens, 11 (1904), p. 239.

Crossrefs

Programs

  • PARI
    lista(nn) = {print1(n=7, ", "); for (k=2, nn, m = 2*n - sqrtint(n)^2; print1(m, ", "); n = m;);} \\ Michel Marcus, Oct 24 2015

A094766 Trajectory of 11 under repeated application of the map n -> n + 2*square excess of n (see A094765).

Original entry on oeis.org

11, 15, 27, 31, 43, 57, 73, 91, 111, 133, 157, 183, 211, 241, 273, 307, 343, 381, 421, 463, 507, 553, 601, 651, 703, 757, 813, 871, 931, 993, 1057, 1123, 1191, 1261, 1333, 1407, 1483, 1561, 1641, 1723, 1807, 1893, 1981, 2071, 2163, 2257, 2353, 2451, 2551, 2653
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Comments

The trajectory of 3 gives A002061 and 5 gives essentially the same trajectory as 3.

Crossrefs

Programs

  • Maple
    f:= n -> 3*n - 2*floor(sqrt(n))^2:
    g:= proc(n) option remember; f(procname(n-1)) end proc:
    g(0):= 11:
    seq(g(n),n=0..100); # Robert Israel, Oct 23 2015
  • Mathematica
    NestList[3*#-2*Floor[Sqrt[#]]^2&,11,50] (* Harvey P. Dale, Feb 26 2022 *)
  • PARI
    lista(nn) = {print1(n=11, ", "); for (k=2, nn, m = 3*n - 2*sqrtint(n)^2; print1(m, ", "); n = m;);} \\ Michel Marcus, Oct 23 2015
    
  • PARI
    Vec(4+2*x+6*x^2+(7-8*x+3*x^2)/(1-x)^3 + O(x^100)) \\ Altug Alkan, Oct 23 2015

Formula

Numbers given satisfy a(n) = n^2 + 5n + 7, for n>2. - Ralf Stephan, Dec 04 2004
From Robert Israel, Oct 23 2015: (Start)
This is because for x = m^2 + 5*m + 7, (m+2)^2 < x < (m+3)^2 so A094765(x) = x + 2*(x-(m+2)^2) = m^2 + 7*m + 13 = (m+1)^2 + 5*(m+1) + 7.
Similarly, for any positive integer k, the trajectory of k^2 + k + 1 is n^2 + (2k+1) n + k^2 + k + 1 for n >= 0.
G.f.: 4 + 2*x + 6*x^2 + (7-8*x+3*x^2)/(1-x)^3. (End)
Previous Showing 21-30 of 46 results. Next