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: Pasi Airikka

Pasi Airikka's wiki page.

Pasi Airikka has authored 6 sequences.

A192324 Sequence of numbers formed as remainder of Mersenne numbers divided by primes.

Original entry on oeis.org

1, 0, 2, 1, 9, 11, 8, 8, 5, 8, 1, 25, 32, 0, 8, 27, 32, 26, 12, 47, 7, 35, 46, 3, 94, 19, 75, 61, 22, 3, 7, 116, 67, 24, 137, 63, 149, 42, 60, 9, 71, 155, 39, 11, 72, 50, 47, 40, 23, 25, 70, 47, 31, 15, 127, 172, 73, 109, 117, 58, 29, 246, 201, 207, 283, 52, 127, 31, 138, 55, 284, 23
Offset: 1

Author

Pasi Airikka, Jun 28 2011

Keywords

Comments

Exponent of Mersenne number formula does not have to be a prime.

Examples

			a(1) = mod(mersenne(1)/prime(1)) = mod(1/2) = 1
a(2) = mod(mersenne(2)/prime(2)) = mod(3/3) = 0
a(3) = mod(mersenne(3)/prime(3)) = mod(7/5) = 2
a(4) = mod(mersenne(4)/prime(4)) = mod(15/7) = 1
a(5) = mod(mersenne(5)/prime(5)) = mod(31/11) = 9
		

Crossrefs

Cf. A000225 (Mersenne), A000040 (prime), A082495.

Programs

  • MATLAB
    % n = number of computed terms of sequence
    for i=1:n,
        a(i) = mod(mersenne(i),prime(i)) ;
    end
    
  • PARI
    a(n) = (2^n-1)%prime(n)
    
  • PARI
    a(n)=lift(Mod(2,prime(n))^n-1) \\ Charles R Greathouse IV, Jun 29 2011

Formula

a(n) = mod (mersenne(n) / prime(n))
where mersenne(n) returns n-th mersenne number and, correspondingly, prime(n) returns n-th prime number.

A192326 Remainders of primes divided by odd numbers.

Original entry on oeis.org

0, 0, 0, 0, 2, 2, 4, 4, 6, 10, 10, 14, 16, 16, 18, 22, 26, 26, 30, 32, 32, 36, 38, 42, 48, 50, 50, 52, 52, 54, 5, 5, 7, 5, 11, 9, 11, 13, 13, 15, 17, 15, 21, 19, 19, 17, 25, 33, 33, 31, 31, 33, 31, 37, 39, 41, 43, 41, 43, 43, 41, 47, 57, 57, 55, 55, 65, 67, 73, 71, 71, 73, 77, 79, 81, 81, 83
Offset: 1

Author

Pasi Airikka, Jun 28 2011

Keywords

Examples

			a(1) = prime(1) mod odd(1) = 2 mod 1 = 0; a(5) = prime(5) mod odd(5) = 11 mod 9 = 2.
		

Crossrefs

Cf. A131733.

Programs

  • MATLAB
    % n = number of computed terms of sequence
    for i=1:n,
        a(n) = mod(prime(i),odd(i)) ;
    end
    
  • Maple
    A192326 := proc(n) modp(ithprime(n),2*n-1) ; end proc:
    seq(A192326(n),n=1..80) ; # R. J. Mathar, Jul 13 2011
  • PARI
    a(n)=prime(n)%(2*n-1) \\ Charles R Greathouse IV, Jun 29 2011

Formula

a(n) = prime(n) mod (2n-1).

A192263 a(n) = abs(a(n-1) - 3*a(n-2)) with a(1)=a(2)=1.

Original entry on oeis.org

1, 1, 2, 1, 5, 2, 13, 7, 32, 11, 85, 52, 203, 47, 562, 421, 1265, 2, 3793, 3787, 7592, 3769, 19007, 7700, 49321, 26221, 121742, 43079, 322147, 192910, 773531, 194801, 2125792, 1541389, 4835987, 211820, 14296141, 13660681, 29227742, 11754301
Offset: 1

Author

Pasi Airikka, Jun 27 2011

Keywords

Examples

			a(3)=abs(1-3*1)=2, a(4)=abs(2-3*1)=1, a(5)=abs(1-3*2)=5, a(6)=abs(5-3*1)=2, a(7)=abs(2-3*5)=13.
		

Programs

  • MATLAB
    % n = number of computed terms of sequence. Beware of 64bit restrictions of MATLAB integers and floating point numbers
    a(1)=1 ; a(2)=1 ;
    for i=3:n,
       a(i) = abs(a(i-1)-3*a(i-2)) ;
    end
    
  • Maple
    A192263 := proc(n) option remember; if n <=2 then 1; else abs(procname(n-1)-3*procname(n-2)) ; end if; end proc: # R. J. Mathar, Jul 12 2011
  • Mathematica
    nxt[{a_,b_}]:={b,Abs[b-3a]}; NestList[nxt,{1,1},40][[All,1]] (* Harvey P. Dale, Dec 16 2021 *)
  • PARI
    N=66; v=vector(N); /* that many terms */
    v[1]=1; v[2]=1; for(n=3,N,v[n]=abs(abs(v[n-1] - 3*v[n-2])));
    v /* show terms */  /* Joerg Arndt, Jul 02 2011 */

A192327 a(n) = prime(n) mod 2*n.

Original entry on oeis.org

0, 3, 5, 7, 1, 1, 3, 3, 5, 9, 9, 13, 15, 15, 17, 21, 25, 25, 29, 31, 31, 35, 37, 41, 47, 49, 49, 51, 51, 53, 3, 3, 5, 3, 9, 7, 9, 11, 11, 13, 15, 13, 19, 17, 17, 15, 23, 31, 31, 29, 29, 31, 29, 35, 37, 39, 41, 39, 41, 41, 39, 45, 55, 55, 53, 53, 63, 65, 71, 69, 69, 71, 75, 77, 79, 79
Offset: 1

Author

Pasi Airikka, Jun 28 2011

Keywords

Examples

			a(1) = prime(1) mod even(1) = 2 mod 2 = 0.
a(5) = prime(5) mod even(5) = 11 mod 10 = 1.
		

Crossrefs

Cf. A004648.

Programs

  • MATLAB
    % n = number of computed terms of sequence
    for i=1:n,
        a(i) = mod(prime(i),even(i)) ;
    end
    
  • Magma
    A192327:=func< n | NthPrime(n) mod 2*n >; [ A192327(n): n in [1..80] ]; // Klaus Brockhaus, Jul 10 2011
  • Maple
    A192327 := proc(n) modp(ithprime(n),2*n) ; end proc:
    seq(A192327(n),n=1..80) ; # R. J. Mathar, Jul 11 2011
  • Mathematica
    Table[Mod[Prime[n], 2n], {n, 50}] (* Alonso del Arte, Jun 29 2011 *)
  • PARI
    a(n)=prime(n)%(2*n) \\ Charles R Greathouse IV, Jun 29 2011
    

Formula

a(n) = A000040(n) mod (2*n).

A192264 a(1)=1, a(2)=2; a(n) = abs((n-1)*a(n-1) - n*a(n-2)), n > 2.

Original entry on oeis.org

1, 2, 1, 5, 15, 45, 165, 795, 4875, 35925, 305625, 2930775, 31196175, 364519425, 4635329325, 63697629075, 940361466675, 14839587610125, 249245709115425, 4438876720990575, 83543374528387575, 1656755577234346425, 34527125085002707125
Offset: 1

Author

Pasi Airikka, Jun 27 2011

Keywords

Examples

			a(3) = abs(a(2)*(3-1) - a(1)*3) = abs(2*2 - 1*3) =  1;
a(4) = abs(a(3)*(4-1) - a(2)*4) = abs(1*3 - 2*4) =  5;
a(5) = abs(a(4)*(5-1) - a(3)*5) = abs(5*4 - 1*5) = 15.
		

Programs

  • MATLAB
    % n = number of computed terms of sequence
    a(1)=1; a(2)=2;
    for i=3:n,
        a(i,1) = abs(a(i-1)*(i-1) - a(i-2)*i) ;
    end
  • Maple
    A192264 := proc(n) if n <=2 then n; else abs( (n-1)*procname(n-1)-n*procname(n-2)) ; end if; end proc: # R. J. Mathar, Jun 27 2011
  • Mathematica
    a[1] = 1; a[2] = 2; a[n_] := a[n] = Abs[(n-1)*a[n-1] - n*a[n-2]]; Table[a[n], {n, 30}]

Formula

a(n) = abs((n-1)*a(n-1) - n*a(n-2)), a(1) = 1, a(2) = 2.

Extensions

Corrected and edited by R. J. Mathar, Jun 27 2011

A192439 a(n) = a(n-1) - a(n-2) if n is prime or a(n-1) + a(n-2) otherwise. a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 1, 3, 4, 7, 3, 10, 7, 17, 24, 41, 17, 58, 41, 99, 140, 239, 99, 338, 437, 775, 1212, 1987, 775, 2762, 1987, 4749, 6736, 11485, 18221, 29706, 11485, 41191, 52676, 93867, 41191, 135058, 93867, 228925, 322792, 551717, 228925, 780642, 1009567
Offset: 1

Author

Pasi Airikka, Jul 01 2011

Keywords

Examples

			a(1) = 1, a(2) = 1.
a(3) = 1 - 1 = 0, as n=3 is prime.
a(4) = 0 + 1 = 1, as n=4 is nonprime.
a(5) = 1 - 0 = 1, as n=5 is prime.
a(6) = 1 + 1 = 2, as n=6 is nonprime.
		

Crossrefs

Programs

  • MATLAB
    a(1)=1;a(2)=1;
    for i=3:n,
        true = isprime(n) ;
        if true,
           a(i)=a(i-1)-a(i-2) ;
        else
           a(i)=a(i-1)+a(i-2) ;
        end
    end
    % isprime returns 1 if n is prime, else 0.
    
  • Mathematica
    nxt[{n_,a_,b_}]:={n+1,b,If[PrimeQ[n+1],b-a,b+a]}; NestList[nxt,{2,1,1},50][[All,2]] (* Harvey P. Dale, Dec 23 2022 *)
  • PARI
    a=vector(100);a[1]=a[2]=1;for(n=3,#a,a[n]=a[n-1]+(1-2*isprime(n))*a[n-2]); a \\ Charles R Greathouse IV, Jul 01 2011

Formula

a(n) = a(n-1) + a(n-2), if n is nonprime.
a(n) = a(n-1) - a(n-2), if n is prime.
a(1) = a(2) = 1.
a(n) >> x^n, with x = 1.28743... the largest real root of x^6 - x^5 + x^4 - x^3 + x^2 - x = 2. - Charles R Greathouse IV, Jul 01 2011