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

A065310 Number of occurrences of n-th prime in A065308, where A065308(j) = prime(j - pi(j)).

Original entry on oeis.org

3, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2
Offset: 1

Views

Author

Labos Elemer, Oct 29 2001

Keywords

Comments

Seems identical to A054546. Each odd prime arises once or twice!?
First differences of A018252 (positive nonprime numbers). Including 0 gives A054546. Removing 1 gives A073783. - Gus Wiseman, Sep 15 2024

Crossrefs

For twin 2's see A169643.
Positions of 1's are A375926, complement A014689 (except first term).
Other families of numbers and their first-differences:
For prime numbers (A000040) we have A001223.
For composite numbers (A002808) we have A073783.
For nonprime numbers (A018252) we have A065310 (this).
For perfect powers (A001597) we have A053289.
For non-perfect-powers (A007916) we have A375706.
For squarefree numbers (A005117) we have A076259.
For nonsquarefree numbers (A013929) we have A078147.
For prime-powers inclusive (A000961) we have A057820.
For prime-powers exclusive (A246655) we have A057820(>1).
For non-prime-powers inclusive (A024619) we have A375735.
For non-prime-powers exclusive (A361102) we have A375708.

Programs

  • Mathematica
    t=Table[Prime[w-PrimePi[w]], {w, a, b}] Table[Count[t, Prime[n]], {n, c, d}]
    Differences[Select[Range[100],!PrimeQ[#]&]] (* Gus Wiseman, Sep 15 2024 *)
  • PARI
    { p=1; f=2; m=1; for (n=1, 1000, a=0; p=nextprime(p + 1); while (p==f, a++; m++; f=prime(m - primepi(m))); write("b065310.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 16 2009

A375927 Numbers k such that A005117(k+1) - A005117(k) = 1. In other words, the k-th squarefree number is 1 less than the next.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 10, 14, 15, 18, 19, 21, 22, 24, 25, 27, 28, 30, 35, 36, 38, 40, 41, 43, 44, 46, 48, 49, 51, 53, 54, 58, 59, 62, 63, 65, 66, 68, 69, 71, 72, 74, 76, 79, 80, 82, 84, 85, 87, 88, 90, 94, 96, 97, 101, 102, 105, 107, 108, 110, 111, 113, 114, 116
Offset: 1

Views

Author

Gus Wiseman, Sep 12 2024

Keywords

Comments

The asymptotic density of this sequence is Product_{p prime} (1 - 1/(p^2-1)) = 0.53071182... (A065469). - Amiram Eldar, Sep 15 2024

Examples

			The squarefree numbers are 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, ... which first increase by one after terms 1, 2, 4, 5, ...
		

Crossrefs

Positions of 1's in A076259.
For prime-powers (A246655) we have A375734.
First differences are A373127.
For nonsquarefree instead of squarefree we have A375709.
For nonprime numbers we have A375926, differences A373403.
For composite numbers we have A375929.
The complement is A375930, differences A120992.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A053797 gives lengths of runs of nonsquarefree numbers, firsts A373199.
A375707 counts squarefree numbers between consecutive nonsquarefree numbers.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],SquareFreeQ[#]&]],1]
  • PARI
    lista(kmax) = {my(is1 = 1, is2, c = 1); for(k = 2, kmax, is2 = issquarefree(k); if(is2, c++); if(is1 && is2, print1(c-1, ", ")); is1 = is2);} \\ Amiram Eldar, Sep 15 2024

A375713 Indices of consecutive non-prime-powers (A361102) differing by 1. Numbers k such that the k-th and (k+1)-th non-prime-powers differ by just one.

Original entry on oeis.org

5, 8, 9, 15, 16, 17, 19, 20, 23, 24, 27, 28, 30, 31, 32, 33, 36, 38, 40, 41, 44, 45, 46, 47, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 63, 64, 67, 68, 71, 72, 74, 75, 76, 77, 78, 79, 81, 82, 85, 87, 88, 89, 90, 93, 94, 95, 96, 97, 98, 99, 100, 103, 104, 105, 106
Offset: 1

Views

Author

Gus Wiseman, Sep 02 2024

Keywords

Examples

			The initial non-prime-powers are 1, 6, 10, 12, 14, 15, 18, 20, 21, which first increase by one after the fifth and eighth terms.
		

Crossrefs

The inclusive version is a(n) - 1.
For prime-powers inclusive (A000961) we have A375734, differences A373671.
For nonprime numbers (A002808) we have A375926, differences A373403.
For prime-powers exclusive (A246655) we have A375734(n+1) + 1.
First differences are A373672.
Positions of 1's in A375708.
For non-perfect-powers we have A375740.
Prime-powers inclusive:
- terms: A000961
- differences: A057820
Non-prime-powers inclusive:
- terms: A361102
- differences: A375708
A000040 lists all of the primes, differences A001223.
A007916 lists non-perfect-powers, differences A375706.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],!PrimePowerQ[#]&]],1]

Formula

A361102(k+1) - A361102(k) = 1.

A375709 Numbers k such that A013929(k+1) = A013929(k) + 1. In other words, the k-th nonsquarefree number is 1 less than the next nonsquarefree number.

Original entry on oeis.org

2, 8, 10, 15, 17, 18, 24, 28, 30, 37, 38, 43, 45, 47, 48, 52, 56, 59, 65, 67, 69, 73, 80, 85, 92, 93, 94, 100, 106, 108, 111, 115, 122, 125, 128, 133, 134, 137, 138, 141, 143, 145, 148, 153, 158, 165, 166, 171, 178, 183, 184, 192, 196, 198, 203, 205, 207, 210
Offset: 1

Views

Author

Gus Wiseman, Sep 01 2024

Keywords

Comments

The difference of consecutive nonsquarefree numbers is at least 1 and at most 4, so there are four disjoint sequences of this type:
- A375709 (difference 1) (this)
- A375710 (difference 2)
- A375711 (difference 3)
- A375712 (difference 4)

Examples

			The initial nonsquarefree numbers are 4, 8, 9, 12, 16, 18, 20, 24, 25, which first increase by one after the 2nd and 8th terms.
		

Crossrefs

Positions of 1's in A078147.
For prime-powers (A246655) we have A375734.
First differences are A373409.
For prime numbers we have A375926.
For squarefree instead of nonsquarefree we have A375927.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A053797 gives lengths of runs of nonsquarefree numbers, firsts A373199.
A375707 counts squarefree numbers between consecutive nonsquarefree numbers.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],!SquareFreeQ[#]&]],1]

Formula

Complement of A375710 U A375711 U A375712.

A375929 Numbers k such that A002808(k+1) = A002808(k) + 1. In other words, the k-th composite number is 1 less than the next.

Original entry on oeis.org

3, 4, 7, 8, 11, 12, 14, 15, 16, 17, 20, 21, 22, 23, 25, 26, 29, 30, 32, 33, 34, 35, 37, 38, 39, 40, 43, 44, 45, 46, 48, 49, 52, 53, 54, 55, 57, 58, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 76, 77, 80, 81, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94
Offset: 1

Views

Author

Gus Wiseman, Sep 12 2024

Keywords

Comments

Positions of 1's in A073783 (see also A054546, A065310).

Examples

			The composite numbers are 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, ... which increase by 1 after positions 3, 4, 7, 8, ...
		

Crossrefs

Positions in A002808 of each element of A068780.
The complement is A065890 shifted.
First differences are A373403 (except first).
The version for non-prime-powers is A375713, differences A373672.
The version for prime-powers is A375734, differences A373671.
The version for non-perfect-powers is A375740.
The version for nonprime numbers is A375926.
A000040 lists the prime numbers, differences A001223.
A000961 lists prime-powers (inclusive), differences A057820.
A002808 lists the composite numbers, differences A073783.
A018252 lists the nonprime numbers, differences A065310.
A046933 counts composite numbers between primes.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],CompositeQ]],1]
  • Python
    from sympy import primepi
    def A375929(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+bisection(lambda y:primepi(x+2+y))-2
        return bisection(f,n,n) # Chai Wah Wu, Sep 15 2024
    
  • Python
    # faster for initial segment of sequence
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        pic, prevc = 0, -1
        for i in count(4):
            if not isprime(i):
                if i == prevc + 1:
                    yield pic
                pic, prevc = pic+1, i
    print(list(islice(agen(), 10000))) # Michael S. Branicky, Sep 17 2024

Formula

a(n) = A375926(n) - 1.

A375734 Indices of consecutive prime-powers (exclusive) differing by 1. Positions of 1's in A057820.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 17, 43, 70, 1077, 6635, 12369, 43578, 105102700
Offset: 1

Views

Author

Gus Wiseman, Sep 04 2024

Keywords

Comments

The corresponding prime-powers A246655(a(n)) are given by A006549.
From A006549, it is not known whether this sequence is infinite.

Examples

			The fifth prime-power is 7 and the sixth is 8, so 5 is in the sequence.
		

Crossrefs

For nonprime numbers (A002808) we have A375926, differences A373403.
Positions of 1's in A057820.
First differences are A373671.
For nonsquarefree numbers we have A375709, differences A373409.
For non-prime-powers we have A375713.
For non-perfect-powers we have A375740.
For squarefree numbers we have A375927, differences A373127.
Prime-powers:
- terms: A000961, complement A024619.
- differences: A057820.
- anti-runs: A373576, A120430, A006549, A373671
Non-prime-powers:
- terms: A361102
- differences: A375708
- anti-runs: A373679, A373575, A255346, A373672
A000040 lists all of the primes, differences A001223.
A025528 counts prime-powers up to n.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],PrimePowerQ]],1]

Formula

Numbers k such that A246655(k+1) - A246655(k) = 1.
The inclusive version is a(n) + 1 shifted.

Extensions

a(14) from Amiram Eldar, Sep 24 2024

A375928 Positions of adjacent non-prime-powers (exclusive) differing by more than 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 10, 11, 12, 13, 14, 18, 21, 22, 25, 26, 29, 34, 35, 37, 39, 42, 43, 48, 49, 50, 55, 62, 65, 66, 69, 70, 73, 80, 83, 84, 86, 91, 92, 101, 102, 107, 112, 115, 116, 119, 124, 125, 134, 135, 138, 139, 150, 161, 164, 165, 168, 173, 174, 175, 182
Offset: 1

Views

Author

Gus Wiseman, Sep 12 2024

Keywords

Examples

			The non-prime-powers (exclusive) are 1, 6, 10, 12, 14, 15, 18, 20, ... which increase by more than 1 after positions 1, 2, 3, 4, 6, 7, ...
		

Crossrefs

For prime-powers inclusive (A000961) we have A376163, differences A373672.
For nonprime numbers (A002808) we have A014689, differences A046933.
First differences are A110969.
The complement is A375713.
For non-perfect-powers we have A375714, complement A375740.
The complement for prime-powers (exclusive) is A375734, differences A373671.
The complement for nonprime numbers is A375926, differences A373403.
A000040 lists the prime numbers, differences A001223.
A000961 lists prime-powers (inclusive), differences A057820.
A007916 lists non-perfect-powers, differences A375706.
A024619 lists non-prime-powers (inclusive), differences A375735.
A246655 lists prime-powers (exclusive), differences A174965.
A361102 lists non-prime-powers (exclusive), differences A375708.

Programs

  • Mathematica
    ce=Select[Range[100],!PrimePowerQ[#]&];
    Select[Range[Length[ce]-1],!ce[[#+1]]==ce[[#]]+1&]

Formula

The inclusive version is a(n+1) - 1.

A375930 Numbers k such that A005117(k+1) - A005117(k) > 1. In other words, the k-th squarefree number is more than 1 less than the next.

Original entry on oeis.org

3, 6, 8, 11, 12, 13, 16, 17, 20, 23, 26, 29, 31, 32, 33, 34, 37, 39, 42, 45, 47, 50, 52, 55, 56, 57, 60, 61, 64, 67, 70, 73, 75, 77, 78, 81, 83, 86, 89, 91, 92, 93, 95, 98, 99, 100, 103, 104, 106, 109, 112, 115, 117, 120, 121, 122, 125, 127, 130, 133, 136, 139
Offset: 1

Views

Author

Gus Wiseman, Sep 12 2024

Keywords

Comments

The asymptotic density of this sequence is 1 - Product_{p prime} (1 - 1/(p^2-1)) = 1 - A065469 = 0.46928817... . - Amiram Eldar, Sep 15 2024

Examples

			The squarefree numbers are 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, ... which first increase by more than one after positions 3, 6, 8, 11, ...
		

Crossrefs

For nonprime numbers: A014689, complement A375926, differences A373403.
For composite numbers: A065890 shifted, complement A375929.
Positions of terms > 1 in A076259.
First differences are A120992, complement A373127.
The complement is A375927.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A053797 gives lengths of runs of nonsquarefree numbers, firsts A373199.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],SquareFreeQ[#]&]],_?(#>1&)]
  • PARI
    lista(kmax) = {my(is1 = 1, is2, c = 1); for(k = 2, kmax, is2 = issquarefree(k); if(is2, c++); if(is1 && !is2, print1(c, ", ")); is1 = is2);} \\ Amiram Eldar, Sep 15 2024

A376163 Positions of adjacent non-prime-powers (inclusive, so 1 is a prime-power) differing by 1.

Original entry on oeis.org

4, 7, 8, 14, 15, 16, 18, 19, 22, 23, 26, 27, 29, 30, 31, 32, 35, 37, 39, 40, 43, 44, 45, 46, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 62, 63, 66, 67, 70, 71, 73, 74, 75, 76, 77, 78, 80, 81, 84, 86, 87, 88, 89, 92, 93, 94, 95, 96, 97, 98, 99, 102, 103, 104, 105
Offset: 1

Views

Author

Gus Wiseman, Sep 13 2024

Keywords

Examples

			The non-prime-powers (inclusive) are 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ... which increase by 1 after positions 4, 7, 8, ...
		

Crossrefs

For prime-powers inclusive (A000961) we have A375734, differences A373671.
For nonprime numbers (A002808) we have A375926, differences A373403.
For prime-powers exclusive (A246655) we have A375734(n+1) + 1.
First differences are A373672.
The exclusive version is a(n) - 1 = A375713.
Positions of 1's in A375735.
For non-perfect-powers we have A375740.
Prime-powers inclusive:
- terms: A000961
- differences: A057820
Non-prime-powers inclusive:
- terms: A361102
- differences: A375708
A000040 lists all of the primes, differences A001223.
A007916 lists non-perfect-powers, differences A375706.

Programs

  • Mathematica
    ce=Select[Range[2,100],!PrimePowerQ[#]&];
    Select[Range[Length[ce]-1],ce[[#+1]]==ce[[#]]+1&]
Showing 1-9 of 9 results.