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-10 of 14 results. Next

A081385 Incorrect version of A006254 (or A111333).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 20, 26, 27, 28, 29, 30, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65
Offset: 1

Views

Author

Michael Joseph Halm, Apr 20 2003

Keywords

Comments

Name was: Numbers just more than half-prime.

Examples

			a(11) = 16 because [(31)/2 + 1/2]=16.
		

References

  • M. J. Halm, More Sequences, Mpossibilities 83, 2003.

Crossrefs

Cf. A000040.

Programs

Formula

a(n) = [p(n)/2 + 1/2].

A006254 Numbers k such that 2k-1 is prime.

Original entry on oeis.org

2, 3, 4, 6, 7, 9, 10, 12, 15, 16, 19, 21, 22, 24, 27, 30, 31, 34, 36, 37, 40, 42, 45, 49, 51, 52, 54, 55, 57, 64, 66, 69, 70, 75, 76, 79, 82, 84, 87, 90, 91, 96, 97, 99, 100, 106, 112, 114, 115, 117, 120, 121, 126, 129, 132, 135, 136, 139, 141, 142, 147, 154, 156, 157
Offset: 1

Views

Author

Keywords

Comments

a(n) is the inverse of 2 modulo prime(n) for n >= 2. - Jean-François Alcover, May 02 2017
The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004
Positions of prime numbers among odd numbers. - Zak Seidov, Mar 26 2013
Also, the integers remaining after removing every third integer following 2, and, recursively, removing every p-th integer following the next remaining entry (where p runs through the primes, beginning with 5). - Pete Klimek, Feb 10 2014
Also, numbers k such that k^2 = m^2 + p, for some integers m and every prime p > 2. Applicable m values are m = k - 1 (giving p = 2k - 1). Less obvious is: no solution exists if m equals any value in A047845, which is the complement of (A006254 - 1). - Richard R. Forberg, Apr 26 2014
If you define a different type of multiplication (*) where x (*) y = x * y + (x - 1) * (y - 1), (which has the commutative property) then this is the set of primes that follows. - Jason Atwood, Jun 16 2019

Crossrefs

Equals A005097 + 1. A130291 is an essentially identical sequence.
Cf. A065091.
Numbers n such that 2n+k is prime: A005097 (k=1), A067076 (k=3), A089038 (k=5), A105760 (k=7), A155722 (k=9), A101448 (k=11), A153081 (k=13), A089559 (k=15), A173059 (k=17), A153143 (k=19).
Numbers n such that 2n-k is prime: this seq(k=1), A098090 (k=3), A089253 (k=5), A089192 (k=7), A097069 (k=9), A097338 (k=11), A097363 (k=13), A097480 (k=15), A098605 (k=17), A097932 (k=19).

Programs

Formula

a(n) = (A000040(n+1) + 1)/2 = A067076(n-1) + 2 = A086801(n-1)/2 + 2.
a(n) = (1 + A065091(n))/2. - Omar E. Pol, Nov 10 2007
a(n) = sqrt((A065091^2 + 2*A065091+1)/4). - Eric Desbiaux, Jun 29 2009
a(n) = A111333(n+1). - Jonathan Sondow, Jan 20 2016

Extensions

More terms from Erich Friedman
More terms from Omar E. Pol, Nov 10 2007

A130290 Number of nonzero quadratic residues modulo the n-th prime.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36, 39, 41, 44, 48, 50, 51, 53, 54, 56, 63, 65, 68, 69, 74, 75, 78, 81, 83, 86, 89, 90, 95, 96, 98, 99, 105, 111, 113, 114, 116, 119, 120, 125, 128, 131, 134, 135, 138, 140, 141, 146, 153, 155, 156, 158
Offset: 1

Views

Author

M. F. Hasler, May 21 2007

Keywords

Comments

Row lengths for formatting A063987 as a table: The number of nonzero quadratic residues modulo a prime p equals floor(p/2), or (p-1)/2 if p is odd. The number of squares including 0 is (p+1)/2, if p is odd (rows prime(i) of A096008 formatted as a table). In fields of characteristic 2, all elements are squares. For any m > 0, floor(m/2) is the number of even positive integers less than or equal to m, so a(n) also equals the number of even positive integers less than or equal to the n-th prime. For all n > 0, A130290(n+1) = A005097(n) = A102781(n+1) = A102781(n+1) = A130291(n+1)-1 = A111333(n+1)-1 = A006254(n)-1.
From Vladimir Shevelev, Jun 18 2016: (Start)
a(1)+2 and, for n >= 2, a(n)+1 is the smallest k such that there exists 0 < k_1 < k with the condition k_1^2 == k^2 (mod prime(n)).
Indeed, for n >= 2, if prime(n) = 4*t+1 then k = 2*t+1 = a(n)+1, since (2*t+1)^2 == (2*t)^2 (mod prime(n)) and there cannot be a smaller value of k; if prime(n) = 4*t-1, then k = 2*t = a(n)+1, since (2*t)^2 == (2*t-1)^2 (mod prime(n)). (End)
a(n) is the number of pairs (a,b) such that a + b = prime(n) with 1 <= a <= b. - Nicholas Leonard, Oct 02 2022

Examples

			a(1)=1 since the only nonzero element of Z/2Z equals its square.
a(3)=2 since 1=1^2=(-1)^2 and 4=2^2=(-2)^2 are the only nonzero squares in Z/5Z.
a(1000000) = 7742931 = (prime(1000000)-1)/2.
		

Crossrefs

Essentially the same as A005097.
Cf. A102781 (Number of even numbers less than the n-th prime), A063987 (quadratic residues modulo the n-th prime), A006254 (Numbers n such that 2n-1 is prime), A111333 (Number of odd numbers <= n-th prime), A000040 (prime numbers), A130291.
Appears in A217983. - Johannes W. Meijer, Oct 25 2012

Programs

Formula

a(n) = floor( A000040(n)/2 ) = #{ even positive integers <= A000040(n) }
a(n) = A055034(A000040(n)), n>=1. - Wolfdieter Lang, Sep 20 2012
a(n) = A005097(n-[n>1]) = A005097(max(n-1,1)). - M. F. Hasler, Dec 13 2019

A049990 a(n) is the number of arithmetic progressions of 2 or more positive integers, nondecreasing with sum n.

Original entry on oeis.org

0, 1, 2, 3, 3, 6, 4, 6, 8, 8, 6, 13, 7, 10, 15, 12, 9, 19, 10, 16, 20, 15, 12, 26, 16, 17, 25, 21, 15, 34, 16, 22, 30, 22, 24, 40, 19, 24, 35, 32, 21, 45, 22, 30, 47, 29, 24, 51, 28, 37, 46, 35, 27, 56, 36, 40, 51, 36, 30, 70, 31, 38, 61, 43
Offset: 1

Views

Author

Keywords

Examples

			a(6) counts these 6 partitions of 6: [5,1], [4,2], [3,3], [3,2,1], [2,2,2], [1,1,1,1,1,1].
		

Crossrefs

Programs

  • Mathematica
    (* Program 1 *)
    Map[Length[Map[#[[2]] &, Select[Map[{Apply[SameQ, Differences[#]], #} &,
    IntegerPartitions[#]], #[[1]] &]]] &, Range[40]] - 1
    (* Peter J. C. Moses, Dec 24 2016 *)
    (* Program 2 *)
    enumerateArithmeticPartitions[n_] := Module[{allDivs, oddDivs},
    {allDivs, oddDivs} = {#, Select[#, OddQ]} &[Divisors[n]]; Map[Reverse, Union[Flatten[Table[If[OddQ[cDiff], (Flatten[
    Map[{If[(2 n - #) cDiff <= # (# - 2), {Table[(cDiff + # - 2 cDiff n/#)/2 +
    cDiff term, {term, 0, 2 n/# - 1}]}, {}], If[# (# - 1) cDiff <= 2 (n - #),
    {Table[(cDiff + 2 n/# - # cDiff)/2 + cDiff term, {term, 0, # - 1}]},
    {}]} &, oddDivs], 2]), (Flatten[Map[If[(n - #) cDiff <= 2 # (# - 1),
    {Table[(cDiff + 2 # - n cDiff/#)/2 + cDiff term, {term, 0, n/# - 1}]}, {}] &,
    allDivs], 1])], {cDiff, 0, n - 2}], 1]]]];
    Join[{0}, Map[Length[enumerateArithmeticPartitions[#]] - 1 &, Range[2, 300]]]
    n = 12; enumerateArithmeticPartitions[12] (* shows the desired partition of n *)
    (* Peter J. C. Moses, Dec 24 2016 *)

Formula

a(A000040(n)) = A111333(n). - Clark Kimberling, Dec 26 2016
From Petros Hadjicostas, Sep 29 2019: (Start)
a(n) = A049988(n) - 1. [Note that A049988 has offset 0.]
G.f.: Sum_{k>=2} x^k/(1-x^(k*(k-1)/2))/(1-x^k). [Leroy Quet from A049988]
(End)

A246372 Numbers n such that 2n-1 = product_{k >= 1} (p_k)^(c_k), then n <= product_{k >= 1} (p_{k-1})^(c_k), where p_k indicates the k-th prime, A000040(k).

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 9, 10, 12, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 31, 33, 34, 35, 36, 37, 40, 42, 44, 45, 46, 47, 48, 49, 51, 52, 54, 55, 56, 57, 60, 62, 64, 65, 66, 67, 69, 70, 71, 72, 75, 76, 78, 79, 80, 81, 82, 84, 85, 87, 89, 90, 91, 92, 93, 96, 97, 99, 100, 101, 102, 103, 105, 106, 107, 108, 109, 110
Offset: 1

Views

Author

Antti Karttunen, Aug 24 2014

Keywords

Comments

Numbers n such that A064216(n) >= n.
Numbers n such that A064989(2n-1) >= n.

Examples

			1 is present, as 2*1 - 1 = empty product = 1.
2 is present, as 2*2 - 1 = 3 = p_2, and p_{2-1} = p_1 = 2 >= 2.
3 is present, as 2*3 - 1 = 5 = p_3, and p_{3-1} = p_2 = 3 >= 3.
5 is not present, as 2*5 - 1 = 9 = p_2 * p_2, and p_1 * p_1 = 4, with 4 < 5.
6 is present, as 2*6 - 1 = 11 = p_5, and p_{5-1} = p_4 = 7 >= 6.
25 is present, as 2*25 - 1 = 49 = p_4^2, and p_3^2 = 5*5 = 25 >= 25.
35 is present, as 2*35 - 1 = 69 = 3*23 = p_2 * p_9, and p_1 * p_8 = 2*19 = 38 >= 35.
		

Crossrefs

Complement: A246371
Union of A246362 and A048674.
Subsequences: A006254 (A111333), A246373 (the primes present in this sequence).

Programs

  • PARI
    default(primelimit, 2^30);
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A064216(n) = A064989((2*n)-1);
    isA246372(n) = (A064216(n) >= n);
    n = 0; i = 0; while(i < 10000, n++; if(isA246372(n), i++; write("b246372.txt", i, " ", n)));
    (Scheme, with Antti Karttunen's IntSeq-library)
    (define A246372 (MATCHING-POS 1 1 (lambda (n) (>= (A064216 n) n))))

A049991 a(n) is the number of arithmetic progressions of 2 or more positive integers, nondecreasing with sum <= n.

Original entry on oeis.org

0, 1, 3, 6, 9, 15, 19, 25, 33, 41, 47, 60, 67, 77, 92, 104, 113, 132, 142, 158, 178, 193, 205, 231, 247, 264, 289, 310, 325, 359, 375, 397, 427, 449, 473, 513, 532, 556, 591, 623, 644, 689, 711, 741, 788, 817, 841, 892, 920, 957, 1003, 1038, 1065, 1121, 1157, 1197, 1248, 1284, 1314, 1384, 1415
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

From Petros Hadjicostas, Sep 29 2019: (Start)
a(n) = Sum_{k = 1..n} A049990(k).
G.f.: (g.f. of A049990)/(1-x). (End)

Extensions

More terms from Petros Hadjicostas, Sep 29 2019

A177226 Triangle read by rows: T(n, k) = 2^(prime(n) - prime(k)) mod prime(n), 1 <= k <= n.

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 2, 4, 1, 6, 3, 9, 5, 1, 7, 10, 9, 12, 4, 1, 9, 13, 16, 4, 13, 16, 1, 10, 5, 6, 11, 9, 7, 4, 1, 12, 6, 13, 9, 2, 12, 18, 16, 1, 15, 22, 20, 5, 13, 25, 7, 9, 6, 1, 16, 8, 2, 16, 1, 8, 16, 4, 8, 4, 1, 19, 28, 7, 11, 3, 10, 33, 36, 30, 34, 27, 1, 21, 31, 18, 25, 40, 10, 16, 4, 31, 37, 40, 16, 1
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 10 2010

Keywords

Examples

			Triangle begins:
   1;
   2,  1;
   3,  4,  1;
   4,  2,  4,  1;
   6,  3,  9,  5,  1;
   7, 10,  9, 12,  4,  1;
   9, 13, 16,  4, 13, 16,  1;
  10,  5,  6, 11,  9,  7,  4,  1;
  12,  6, 13,  9,  2, 12, 18, 16,  1;
		

Crossrefs

Programs

  • Magma
    A177226:= func< n,k | Modexp(2, NthPrime(n) - NthPrime(k), NthPrime(n)) >;
    [A177226(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 09 2024
    
  • Mathematica
    Flatten[Table[PowerMod[2,Prime[n]-Prime[k],Prime[n]],{n,20},{k,n}]] (* Harvey P. Dale, May 10 2014 *)
  • SageMath
    def A177226(n,k): return pow(2, nth_prime(n) - nth_prime(k), nth_prime(n))
    flatten([[A177226(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Apr 09 2024

Formula

From G. C. Greubel, Apr 09 2024: (Start)
T(n, 1) = A111333(n).
T(n, 2) = A292411(n). (End)

Extensions

Corrected by D. S. McNeil, Dec 10 2010

A245685 Sigma(2p)/2, for odd primes p.

Original entry on oeis.org

6, 9, 12, 18, 21, 27, 30, 36, 45, 48, 57, 63, 66, 72, 81, 90, 93, 102, 108, 111, 120, 126, 135, 147, 153, 156, 162, 165, 171, 192, 198, 207, 210, 225, 228, 237, 246, 252, 261, 270, 273, 288, 291, 297, 300, 318, 336, 342, 345, 351, 360, 363, 378, 387, 396, 405
Offset: 1

Views

Author

Hartmut F. W. Hoft, Jul 29 2014

Keywords

Comments

The symmetric representation of sigma(2*p), p > 3 prime, consists of two sections each with three contiguous legs of width one (for a proof see the link).
The two ratios of successive legs in the symmetric representation of sigma(2*p) are integers 3 and 2, respectively, for all primes p > 3 satisfying p = -1(mod 6); see also A003627. If one ratio is an integer then so is the other.
The sequence 2*p for primes p > 3 is a subsequence of A239929, numbers n whose symmetric representation of sigma(n) has two parts.
Since sigma(2*p) = 3*(p+1), each element of the sequence is a multiple of 3; furthermore, a(n)/3 = A006254(n) = A111333(n+1).

Examples

			a(4) = T(22, 1) - T(22, 4) = 22 - 4 = 18 = sigma(22)/2
The last image in the Example section of A237593 includes the first four symmetric representations for this sequence, i.e., when 2*p = 10, 14, 22 & 26; see also the link for an image of the first 10 symmetric representations.
		

Crossrefs

Programs

  • Magma
    [3*(NthPrime(n+1)+1)/2: n in [1..60]]; // Vincenzo Librandi, Sep 19 2014
    
  • Mathematica
    a[n_]:=3(Prime[n+1]+1)/2
    Map[a,Range[55]] (* data *)
    DivisorSigma[1,2#]/2&/@Prime[Range[2,60]] (* Harvey P. Dale, Jan 07 2023 *)
  • PARI
    vector(100,n,3*(prime(n+1)+1)/2) \\ Derek Orr, Sep 19 2014
    
  • PARI
    vector(60, n, sigma(2*prime(n+1))/2) \\ Michel Marcus, Nov 25 2014

Formula

a(n) = T(2*prime(n+1), 1) - T(2*prime(n+1), 4) = 3*(prime(n+1)+1)/2 = sigma(2*prime(n+1))/2 where T(n,k) is defined in A235791.
a(n)=A247159(n+1)/2. - Omar E. Pol, Nov 22 2014

A130291 Number of quadratic residues (including 0) modulo the n-th prime.

Original entry on oeis.org

2, 2, 3, 4, 6, 7, 9, 10, 12, 15, 16, 19, 21, 22, 24, 27, 30, 31, 34, 36, 37, 40, 42, 45, 49, 51, 52, 54, 55, 57, 64, 66, 69, 70, 75, 76, 79, 82, 84, 87, 90, 91, 96, 97, 99, 100, 106, 112, 114, 115, 117, 120, 121, 126, 129, 132, 135, 136, 139, 141, 142, 147, 154, 156, 157
Offset: 1

Views

Author

M. F. Hasler, May 21 2007

Keywords

Comments

The number of squares (quadratic residues including 0) modulo a prime p (sequence A096008 with every "1" prefixed by a "0") equals 1+floor(p/2), or ceiling(p/2) = (p+1)/2 if p is odd. (In fields of characteristic 2, all elements are squares.) See A130290(n)=A130291(n)-1 for number of nonzero residues. For all n>0, A130291(n+1) = A111333(n+1) = A006254(n) = A005097(n)-1 = A102781(n+1)-1 = A102781(n+1)-1 = A130290(n+1)-1.

Examples

			a(1)=2 since both elements of Z/2Z are squares.
a(3)=0 since 0=0^2, 1=1^2=(-1)^2 and 4=2^2=(-2)^2 are squares in Z/5Z.
a(1000000) = 7742932 = (p[1000000]+1)/2.
		

Crossrefs

Essentially the same as A006254.
Cf. A005097 (Odd primes - 1)/2, A102781 (Integer part of n#/(n-2)#/2#), A102781 (Number of even numbers less than the n-th prime), A063987 (quadratic residues modulo the n-th prime), A006254 (Numbers n such that 2n-1 is prime), A111333 (Number of odd numbers <= n-th prime), A000040 (prime numbers), A130290 (number of nonzero residues modulo primes).

Programs

Formula

a(n) = floor( A000040(n)/2 )+1

A008508 Number of odd primes less than n-th odd composite number.

Original entry on oeis.org

3, 5, 7, 8, 8, 10, 10, 11, 13, 14, 14, 15, 15, 17, 17, 18, 20, 20, 21, 22, 22, 23, 23, 23, 24, 26, 28, 29, 29, 29, 29, 29, 29, 30, 31, 31, 33, 33, 33, 33, 35, 35, 36, 36, 37, 38, 38, 39, 39, 41, 41, 41, 41, 43, 45, 45, 45, 45, 45, 46
Offset: 1

Views

Author

Gary Findley (chfindley(AT)alpha.nlu.edu), Mar 15 1996

Keywords

Examples

			The first odd composite is 9, and there are 4 primes below: 2, 3, 5, and 7; so there are 3 odd primes, hence a(1)=3.
		

Crossrefs

Programs

  • Mathematica
    PrimePi[#] - 1 & /@ Select[Range@ 213, CompositeQ@ # && OddQ@ # &] (* Michael De Vlieger, Apr 17 2015 *)
  • PARI
    lista(nn) = {forcomposite (n=1, nn, if (n % 2, print1(primepi(n)-1, ", ")););} \\ Michel Marcus, Apr 18 2015
    
  • Python
    from sympy import primepi
    def A008508(n):
        if n == 1: return 3
        m, k = n, (r:=primepi(n)) + n + (n>>1)
        while m != k:
            m, k = k, (r:=primepi(k)) + n + (k>>1)
        return r-1 # Chai Wah Wu, Aug 01 2024

Formula

From Antti Karttunen, Apr 17 2015: (Start)
a(n) = A000720(A071904(n)) - 1 (by the definition).
a(n) = A053726(n) - n - 1.
(End)
Showing 1-10 of 14 results. Next