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

A024699 a(n) = (prime(n+2)-1)/6 if this is an integer or (prime(n+2)+ 1)/6 otherwise.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also number of partitions of n-th prime > 3 into a sum of 2's or 3's (inclusive or).
From Wolfdieter Lang, Mar 13 2012: (Start)
The primes of the form 6*k+1 are given in A002476.
For n >= 1 such that prime(n+2) is from A002476, one has 8*T(prime(n+2)-1) + 1 = r(n)^2, n >= 1, with the triangular numbers T(n) = A000217(n) and r(n) = A208296(n). Therefore, 24*prime(n+2)*a(n) + 1 = r(n)^2. E.g., n=2: prime(4)=7, a(2)=1, 8*21 + 1 = 13^2 = A208296(2)^2 = 24*7*1 + 1.
The primes of the form 6*k-1 are given in A007528.
For n >= 1 such that prime(n+2) is from A007528, one has 8*T(prime(n+2)) + 1 = r(n)^2. For T and r see the preceding comment. Therefore, 24*prime(n+2)*a(n) + 1 = r(n)^2. E.g., n=1, prime(3)=5, a(1)=1, 8*15 + 1 = 11^2 = A208296(1)^2 = 24*5*1 + 1.
(End)

Programs

  • Magma
    [(NthPrime(n+2)+3) div 6: n in [1..80]]; // Vincenzo Librandi, Sep 06 2016
  • Maple
    From R. J. Mathar, May 02 2010: (Start)
    A103221 := proc(n) a := 0 ; for t from 0 do if 2*t > n then return a; end if; if n-2*t mod 3 = 0 then a := a+1 ; end if; end do : end proc:
    A024699 := proc(n) A103221(ithprime(n+2)) ; end proc: seq(A024699(n),n=1..120) ; (End)
  • Mathematica
    pi6[n_]:=Module[{p=Prime[n+2],c},c=(p-1)/6;If[IntegerQ[c],c,(p+1)/6]]; Array[pi6,80] (* Harvey P. Dale, Aug 19 2013 *)
    Table[Floor[(Prime[n + 2] + 3) / 6], {n, 100}] (* Vincenzo Librandi, Sep 06 2016 *)
  • PARI
    a(n) = (prime(n+2)+3)\6; \\ Michel Marcus, Sep 06 2016; after Wolfdieter Lang
    

Formula

a(n) = A103221(prime(n+2)). - R. J. Mathar, May 02 2010
a(n) = floor((prime(n+2)+3)/6), n >= 1, prime(n)=A000040(n). Consider the two cases prime(n+2) == 1 (mod 6) and == -1 (mod 6) separately. See the formula above. - Wolfdieter Lang, Mar 15 2012

A347682 Array read by antidiagonals: T(n,k) (n>=1, k>=1) = f(prime(n),prime(k)), where f(x,y) = x*red_inv(x,y) + y*red_inv(y,x) if gcd(x,y)=1, or 0 if gcd(x,y)>1, and red_inv is defined in the comments.

Original entry on oeis.org

0, 5, 5, 9, 0, 9, 13, 11, 11, 13, 21, 13, 0, 13, 21, 25, 23, 29, 29, 23, 25, 33, 25, 21, 0, 21, 25, 33, 37, 35, 51, 43, 43, 51, 35, 37, 45, 37, 69, 27, 0, 27, 69, 37, 45, 57, 47, 39, 69, 131, 131, 69, 39, 47, 57, 61, 59, 91, 113, 67, 0, 67, 113, 91, 59, 61, 73, 61, 59, 139, 153, 103, 103, 153, 139, 59, 61, 73
Offset: 1

Views

Author

N. J. A. Sloane, Sep 18 2021

Keywords

Comments

If u, v are positive integers with gcd(u,v) = 1, the "reduced inverse" red_inv(u,v) of u mod v is u^(-1) mod v if u^(-1) mod v <= v/2, otherwise it is v - u^(-1) mod v.
That is, we map u to whichever of +-u has a representative mod v in the range 0 to v/2. Stated another way, red_inv(u,v) is a number r in the range 0 to v/2 such that r*u == +-1 mod v.
For example, red_inv(3,11) = 4, since 3^(-1) mod 11 = 4. But red_inv(2,11) = 5 = 11-6, since red_inv(2,11) = 6.
Arises in the study of A344005.

Examples

			The array begins:
0, 5, 9, 13, 21, 25, 33, 37, 45, 57, 61, 73,...
5, 0, 11, 13, 23, 25, 35, 37, 47, 59, 61, 73,...
9, 11, 0, 29, 21, 51, 69, 39, 91, 59, 61, 149,...
13, 13, 29, 0, 43, 27, 69, 113, 139, 57, 125, 223,...
21, 23, 21, 43, 0, 131, 67, 153, 45, 175, 309, 221,...
25, 25, 51, 27, 131, 0, 103, 77, 183, 233, 311, 443,...
33, 35, 69, 69, 67, 103, 0, 305, 137, 407, 373, 443,...
37, 37, 39, 113, 153, 77, 305, 0, 229, 115, 495, 75,...
...
The first few antidiagonals are:
[0]
[5, 5]
[9, 0, 9]
[13, 11, 11, 13]
[21, 13, 0, 13, 21]
[25, 23, 29, 29, 23, 25]
[33, 25, 21, 0, 21, 25, 33]
[37, 35, 51, 43, 43, 51, 35, 37]
...
		

Crossrefs

Rows 1 and 2 are (essentially) A076274 and A208296.

Programs

  • Maple
    myfun1 := proc(A,B) local Ar,Br;
    if igcd(A,B) > 1 then return(0); fi;
      Ar:=(A)^(-1) mod B;
       if 2*Ar > B then Ar:=B-Ar; fi;
      Br:=(B)^(-1) mod A;
       if 2*Br > A then Br:=A-Br; fi;
    A*Ar+B*Br;
    end;
    myfun2:=(i,j)->myfun1(ithprime(i),ithprime(j));
    for i from 1 to 30 do lprint([seq(myfun2(i-j+1,j),j=1..i)]); od:

A207336 One half of smallest positive nontrivial even solution of the congruence x^2 == 1 (mod A001748(n+2)), n>=1.

Original entry on oeis.org

2, 4, 5, 7, 8, 10, 11, 14, 16, 19, 20, 22, 23, 26, 29, 31, 34, 35, 37, 40, 41, 44, 49, 50, 52, 53, 55, 56, 64, 65, 68, 70, 74, 76, 79, 82, 83, 86, 89, 91, 95, 97, 98, 100, 106, 112, 113, 115, 116, 119
Offset: 1

Views

Author

Wolfdieter Lang, Mar 14 2012

Keywords

Comments

See the comments on A208296, which gives the representatives of the odd nontrivial solutions of the congruence x^2 == 1 (mod 3*prime(n+2)), with primes prime(n+2)=A000040(n+2), n>=1.

Examples

			The actual solutions are 4, 8, 10, 14, 16, 20, 22, 28, 32, 38, 40, 44, 46, 52, 58, 62, 68, 70, 74, 80, 82, 88, 98, 100, 104, 106, 110, 112, 128, 130, 136, 140, 148, 152, 158, 164, 166, 172, 178, 182, 190, 194, 196, 200, 212, 224, 226, 230, ...
n=4: 2*a(4) = 14 = 3*13 - 25. 14^2 = 196 == 1 (mod 39), 25^2 = 625 == 1 (mod 39). Representatives of the trivial solutions are 1 and 39-1= 38. All-together there are 4 incongruent solutions.
		

Crossrefs

Programs

  • Mathematica
    Table[(3*Prime[n+2]-SelectFirst[Solve[x^2==1 && x !=1,x,Modulus->3*Prime[n+2]][[All,1,2]],OddQ])/2, {n, 50}] (* Jon Maiga, Sep 28 2019 *)

Formula

a(n) = (3*prime(n+2) - A208296(n))/2, with the primes prime(n+2) = A000040(n+2), n>=1.
Showing 1-3 of 3 results.