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-5 of 5 results.

A128280 a(n) is the least number not occurring earlier such that a(n)+a(n-1) is prime, a(0) = 0.

Original entry on oeis.org

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

Views

Author

Zak Seidov, May 03 2007

Keywords

Comments

Original definition: start with a(1) = 2. See A055265 for start with a(1) = 1.
The sequence may well be a rearrangement of natural numbers. Interestingly, subsets of first n terms are permutations of 1..n for n = {2, 4, 8, 10, 18, 22, 24, 56, ...}. E.g., first 56 terms: {2, 1, 4, 3, 8, 5, 6, 7, 10, 9, 14, 15, 16, 13, 18, 11, 12, 17, 20, 21, 22, 19, 24, 23, 30, 29, 32, 27, 26, 33, 28, 25, 34, 37, 36, 31, 40, 39, 44, 35, 38, 41, 42, 47, 50, 51, 46, 43, 54, 49, 48, 53, 56, 45, 52, 55} are a permutation of 1..56.
Without altering the definition nor the existing values, one can as well start with a(0) = 0 and get (conjecturally) a permutation of the nonnegative integers. This sequence is in some sense the "arithmetic" analog of the "digital" variant A231433: Here we add subsequent terms, there the digits are concatenated. - M. F. Hasler, Nov 09 2013
The sequence is also a particular case of "among the pairwise sums of any M consecutive terms, N are prime", with M = 2, N = 1. For other M, N see A329333, A329405 ff, A329449 ff and the OEIS Wiki page. - M. F. Hasler, Nov 24 2019

Crossrefs

Cf. A083236.
Cf. A055265 for the variant starting with a(1) = 1, and A329333, A329405, ..., A329425 and A329449, ..., A329581 for other variants. - M. F. Hasler, Nov 24 2019

Programs

  • PARI
    {a=0;u=0; for(n=1, 99, u+=1<
    				

Formula

a(2n-1) = A055265(2n-1) + 1, a(2n) = A055265(2n) - 1, for all n >= 1. - M. F. Hasler, Feb 11 2020

Extensions

Initial a(0) = 0 prefixed by M. F. Hasler, Nov 09 2013

A083237 First order recursion: a(0)=5; a(n)=prime(n)-a(n-1).

Original entry on oeis.org

5, -3, 6, -1, 8, 3, 10, 7, 12, 11, 18, 13, 24, 17, 26, 21, 32, 27, 34, 33, 38, 35, 44, 39, 50, 47, 54, 49, 58, 51, 62, 65, 66, 71, 68, 81, 70, 87, 76, 91, 82, 97, 84, 107, 86, 111, 88, 123, 100, 127, 102, 131, 108, 133, 118, 139, 124, 145, 126, 151, 130, 153, 140, 167, 144, 169, 148, 183, 154, 193, 156, 197, 162, 205, 168, 211, 172
Offset: 0

Views

Author

Labos Elemer, Apr 23 2003

Keywords

Comments

Same function as in A083236 but initial value = 5.

Crossrefs

Programs

  • Maple
    A083237 := proc(n)
        option remember ;
        if n = 0 then
            5 ;
        else
            ithprime(n)-procname(n-1) ;
        end if;
    end proc:
    seq(A083237(n),n=0..100) ; # R. J. Mathar, Jun 20 2021
  • Mathematica
    RecursionLimit$=10000; f[x_] := Prime[x]-f[x-1]; f[0]=5; Table[f[w], {w, 1, 100}]

Formula

Same implicit relationship: a(n-1)+a(n)=prime(n), the n-th prime;
It follows also that A001223(n)=a(n+1)-a(n-1).

Extensions

a(0) preprended. - R. J. Mathar, Jun 20 2021

A083238 First order recursion: a(0)=1; a(n) = sigma(1,n) - a(n-1).

Original entry on oeis.org

1, 0, 3, 1, 6, 0, 12, -4, 19, -6, 24, -12, 40, -26, 50, -26, 57, -39, 78, -58, 100, -68, 104, -80, 140, -109, 151, -111, 167, -137, 209, -177, 240, -192, 246, -198, 289, -251, 311, -255, 345, -303, 399, -355, 439, -361, 433, -385, 509, -452, 545, -473, 571, -517, 637, -565, 685, -605, 695, -635, 803, -741, 837, -733, 860
Offset: 0

Views

Author

Labos Elemer, Apr 23 2003

Keywords

Comments

Provide interesting decomposition: sigma(n)=u+w, where u and w consecutive terms of this sequence; this depends also on initial value.

Crossrefs

Programs

  • Mathematica
    f[x_] := DivisorSigma[1, x]-f[x-1] f[0]=1; Table[f[w], {w, 1, 100}]
    nxt[{n_,a_}]:={n+1,DivisorSigma[1,n+1]-a}; NestList[nxt,{0,1},70][[;;,2]] (* Harvey P. Dale, May 10 2024 *)
  • PARI
    lista(nn) = {my(last = 1, v=vector(nn)); for (n=1, nn, v[n] = sigma(n) - last; last = v[n]; ); concat(1, v); } \\ Michel Marcus, Mar 28 2020

Formula

It follows that a(n)+a(n-1) = A000203(n).

A083239 First order recursion: a(0) = 1; a(n) = phi(n) - a(n-1) = A000010(n) - a(n-1).

Original entry on oeis.org

1, 0, 1, 1, 1, 3, -1, 7, -3, 9, -5, 15, -11, 23, -17, 25, -17, 33, -27, 45, -37, 49, -39, 61, -53, 73, -61, 79, -67, 95, -87, 117, -101, 121, -105, 129, -117, 153, -135, 159, -143, 183, -171, 213, -193, 217, -195, 241, -225, 267, -247, 279, -255, 307, -289, 329, -305, 341, -313, 371, -355, 415, -385, 421, -389, 437, -417
Offset: 0

Views

Author

Labos Elemer, Apr 23 2003

Keywords

Comments

Provides interesting decomposition: phi(n) = u+w, where u and w consecutive terms of this sequence. Depends also on initial value.

Crossrefs

Programs

  • Maple
    A083239 := proc(n)
        option remember ;
        if n = 0 then
            1 ;
        else
            numtheory[phi](n)-procname(n-1) ;
        end if;
    end proc:
    seq(A083239(n),n=0..100) ; # R. J. Mathar, Jun 20 2021
  • Mathematica
    a[n_] := a[n] = EulerPhi[n] -a[n-1]; a[0] = 1; Table[a[n], {n, 0, 100}]
  • Python
    # uses programs from A002088 and A049690
    def A083239(n): return A002088(n)-(A049690(n>>1)<<1)-1 if n&1 else 1+(A049690(n>>1)<<1)-A002088(n) # Chai Wah Wu, Aug 04 2024

Formula

a(n) + a(n-1) = A000010(n).
a(n) = (-1)^n * (1 - A068773(n)) for n >= 1. - Amiram Eldar, Mar 05 2024

Extensions

a(0)=1 prepended by R. J. Mathar, Jun 20 2021

A273960 a(n) = (-1)^n*prime(n).

Original entry on oeis.org

-2, 3, -5, 7, -11, 13, -17, 19, -23, 29, -31, 37, -41, 43, -47, 53, -59, 61, -67, 71, -73, 79, -83, 89, -97, 101, -103, 107, -109, 113, -127, 131, -137, 139, -149, 151, -157, 163, -167, 173, -179, 181, -191, 193, -197, 199, -211, 223, -227, 229, -233, 239, -241, 251, -257, 263, -269, 271
Offset: 1

Views

Author

Terry D. Grant, Jun 12 2016

Keywords

Examples

			a(1) = 2*(-1)^1 = -2.
a(2) = 3*(-1)^2 = 3.
a(3) = 5*(-1)^3 = -5.
		

Crossrefs

Programs

  • Mathematica
    Table[Prime[n]*(-1)^n,{n,1,70}]
    Table[If[OddQ[n],-Prime[n],Prime[n]],{n,70}] (* Harvey P. Dale, Jul 01 2016 *)
  • PARI
    a(n) = prime(n)*(-1)^n \\ Felix Fröhlich, Jun 15 2016

Formula

a(n) = A000040(n)*A033999(n). - Felix Fröhlich, Jun 15 2016
Showing 1-5 of 5 results.