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.

Previous Showing 11-17 of 17 results.

A100319 Even numbers m such that at least one of m-1 and m+1 is composite.

Original entry on oeis.org

8, 10, 14, 16, 20, 22, 24, 26, 28, 32, 34, 36, 38, 40, 44, 46, 48, 50, 52, 54, 56, 58, 62, 64, 66, 68, 70, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 104, 106, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 140, 142, 144, 146, 148
Offset: 1

Views

Author

Rick L. Shepherd, Nov 13 2004

Keywords

Comments

Subsequence of A100318. For each k >= 0, a(k+1) = a(k) + 2 unless a(k) + 1 and a(k) + 3 are twin primes, in which case a(k+1) = a(k) + 4 (as a(k) - 1 and a(k) + 5 are divisible by 3).
The even nonisolated primes(n+1). - Juri-Stepan Gerasimov, Nov 09 2009

Crossrefs

Cf. A100318 (supersequence containing odd and even n), A045718 (n such that at least one of n-1 and n+1 is prime).
Cf. A167692(the even nonisolated nonprimes). - Juri-Stepan Gerasimov, Nov 09 2009
Complement of A014574 (average of twin prime pairs) w.r.t. A005843 (even numbers), except for missing term 2.

Programs

  • Mathematica
    Select[2*Range[100], CompositeQ[#-1] || CompositeQ[#+1] &]  (* G. C. Greubel, Mar 09 2019 *)
  • PARI
    forstep(n=4,300,2,if(isprime(n-1)+isprime(n+1)<=1,print1(n,",")))
    
  • Sage
    [n for n in (3..250) if mod(n,2)==0 and (is_prime(n-1) + is_prime(n+1)) < 2] # G. C. Greubel, Mar 09 2019

Formula

a(n) = A167692(n+1). - Juri-Stepan Gerasimov, Nov 09 2009

A121764 Single (or isolated or non-twin) primes of form 6n + 1.

Original entry on oeis.org

37, 67, 79, 97, 127, 157, 163, 211, 223, 277, 307, 331, 337, 367, 373, 379, 397, 409, 439, 457, 487, 499, 541, 547, 577, 607, 613, 631, 673, 691, 709, 727, 733, 739, 751, 757, 769, 787, 853, 877, 907, 919, 937, 967, 991, 997, 1009, 1039, 1069, 1087, 1117
Offset: 1

Views

Author

Lekraj Beedassy, Aug 20 2006

Keywords

Comments

For the first 30000 terms a(n) > A121762(n), see plot A121764(n) - A121762(n). But is it so for all n? - Zak Seidov, Apr 25 2015
Subsequence of A002476. - Michel Marcus, Apr 26 2015

Crossrefs

Programs

  • Magma
    [n: n in [1..1150] | (n mod 6 eq 1) and not IsPrime(n-2) and  IsPrime(n)]; // G. C. Greubel, Feb 26 2019
    
  • Mathematica
    Select[Table[6n + 1, {n, 200}], PrimeQ[#] && !PrimeQ[#-2] &] (* Ray Chandler, Aug 22 2006 *)
    Select[Prime[Range[200]],Mod[#,6]==1&&NoneTrue[#+{2,-2},PrimeQ]&] (* Harvey P. Dale, Jul 16 2021 *)
  • PARI
    {is(n)=n%6==1 && isprime(n) && !isprime(n-2)}; \\ G. C. Greubel, Feb 26 2019
    
  • Sage
    [n for n in (1..1150) if mod(n,6)==1 and not is_prime(n-2) and is_prime(n)] # G. C. Greubel, Feb 26 2019

Extensions

Extended by Ray Chandler, Aug 22 2006

A192489 Numbers m such that A099427(m) = 2.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37, 41, 43, 47, 49, 53, 55, 59, 61, 67, 71, 73, 77, 79, 83, 85, 89, 91, 95, 97, 101, 103, 107, 109, 113, 115, 119, 121, 127, 131, 133, 137, 139, 143, 145, 149, 151, 155, 157, 161, 163, 167, 169, 173, 175, 179
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 02 2011

Keywords

Comments

A099427(a(n)) = 2;
primes and squares of primes greater than 9 are subsequences, cf. A000040, A001248, A000430;
GCD(A099427(a(n)-1), A099427(a(n))) = 1;
a(n) = A038179(n) for n <= 22.
The next term divisible by 3 is a(137)=429. - Joe Slater, Jan 10 2017
All terms after the first are odd, since A099427(n) == n+1 (mod 2) for n >= 3. - Robert Israel, Jan 10 2017

Programs

  • Haskell
    a192489 n = a192489_list !! (n-1)
    a192489_list = f 2 1 where
       f n x | x' == 2   = n : f (n+1) x'
             | otherwise = f (n+1) x'
             where x' = 1 + gcd n x
  • Maple
    A099427:= proc(n) option remember; 1 + igcd(n,procname(n-1)) end proc:
    A099427(1):= 1:
    select(A099427=2, [$1..1000]); # Robert Israel, Jan 10 2017
  • Mathematica
    (* b = A099427 *) b[1] = 1; b[n_] := b[n] = GCD[n, b[n - 1]] + 1;
    Select[Range[200], b[#] == 2&] (* Jean-François Alcover, Mar 10 2019 *)

A227864 Smallest base in which n's digital reversal is prime, or 0 if no such base exists.

Original entry on oeis.org

0, 0, 3, 2, 0, 2, 2, 2, 4, 6, 2, 2, 2, 2, 2, 3, 8, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 9, 2, 2, 6, 2, 4, 3, 2, 3, 12, 2, 6, 3, 2, 2, 6, 2, 2, 3, 2, 2, 2, 3, 2, 9, 2, 2, 3, 2, 2, 3, 2, 4, 12, 2, 2, 3, 12, 3, 6, 2, 2, 3, 10, 2, 6, 2, 2, 3, 10, 2, 26, 3, 2, 27, 2, 2
Offset: 0

Views

Author

Carl R. White, Nov 01 2013

Keywords

Comments

0 and 1 are not prime and are single digits in all bases, so no reversal of digits can make them prime. a(n) is therefore 0 for both.
4 is not prime and so cannot be prime if reversed in any base where it is a single digit. This leaves bases 2 and 3 where, upon reversal, it is 1 and 4 respectively. Neither are prime, and so a(4) is also 0.
Conjecture 1: 0, 1 and 4 are the only values where there is no base in which a digital reversal makes a prime.
It is clear that for any prime p, a(p) cannot be zero, since a(p)=p+1 is a solution if there is none smaller.
Conjecture 2: n = 2 is the only prime p which must be represented in base p+1, i.e., trivially, as a single digit, in order for its reversal to be prime.
Corollary: Since a(n) cannot be n itself -- reversing n in base n obtains 1, which is not prime -- this would mean that for all positive n except 2, a(n) < n.
Other than its small magnitude, a(n) = 2 occurs often due to the fact that a reversed positive binary number is guaranteed to be odd and thus stands a greater chance of being prime.
Similarly, many solutions exist solely because reversal removes all powers of the base from n, reducing the number of divisors. Thus based solely on observation:
Conjecture 3: With the restriction gcd(base,n) = 1, a(n) = 0 except for n = 2, 3 and 6k+-1, for positive integer k, i.e., terms of A038179.

Examples

			9 in base 2 is 1001, which when reversed is the same and so not prime. In base 3 it is 100, which becomes 1 when reversed and also not prime. Base 4: 21 -> 12 (6 decimal), not prime; Base 5: 14 -> 41 (21 decimal), not prime; Base 6: 13 -> 31 (19 decimal), which is prime, so a(9) = 6, i.e., 6 is the smallest base in which 9's digital reversal is a prime number.
		

Crossrefs

Positions of 2's: A204232.

Programs

  • Python
    from sympy import isprime
    from sympy.ntheory.digits import digits
    def okb(n, b):
        return isprime(sum(d*b**i for i, d in enumerate(digits(n, b)[1:])))
    def a(n):
        for b in range(2, n+2):
            if okb(n, b): return b
        return 0
    print([a(n) for n in range(84)]) # Michael S. Branicky, Sep 06 2021

A216240 Composite numbers arising in Eratosthenes sieve with removing the multiples of every other remaining numbers after 2 (see comment).

Original entry on oeis.org

9, 21, 33, 49, 51, 77, 87, 119, 121, 123, 141, 177, 187, 201, 203, 219, 237, 287, 289, 291, 309, 319, 327, 329, 357, 393, 413, 417, 447, 451, 469, 471, 493, 501, 511, 517, 543, 553, 573, 591, 633, 649, 669, 679, 687, 697, 721, 723, 737, 763, 771, 799, 803, 807
Offset: 1

Views

Author

Vladimir Shevelev, Mar 14 2013

Keywords

Comments

We remove even numbers except for 2. The first two remaining numbers are 3,5. Further we remove all remaining numbers multiple of 5,except for 5. The following two remaining numbers are 7,9. Now we remove all remaining numbers multiple of 9, except for 9, etc. The sequence lists the remaining composite numbers.
Conjecture. There exists x_0 such that for every x>=x_0, the number of a(n)<=x is more than pi(x).

Crossrefs

Programs

  • Mathematica
    Module[{a=Insert[Range[1,1000,2], 2, 2], k=4}, While[Length[a] >= 2k, a = Flatten[{Take[a,k], Select[Take[a,-Length[a]+k], Mod[#,a[[k]]] != 0 &]}]; k+=2]; Rest[Select[a,!PrimeQ[#]&]]] (* Peter J. C. Moses, Mar 27 2013 *)

A230773 Minimum number of steps in an alternate definition of the Sieve of Eratosthenes needed to identify n as prime or composite.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 4, 1, 2, 1, 4, 1, 3, 1, 2, 1, 4, 1, 4, 1, 2, 1, 3, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 4, 1, 3, 1, 2
Offset: 1

Views

Author

Jean-Christophe Hervé, Oct 30 2013

Keywords

Comments

This sequence differs from A055399 on prime numbers; as they are never removed during the sieve, it is partly a matter of convention to decide at which step they are classified as prime. Because the smallest integer to be removed at step k is prime(k)^2, integers between prime(k)^2 and prime(k+1)^2 and not removed after step k are known as prime after this step.
This is how this sequence is defined for noncomposite numbers (primes and 1): for any noncomposite number n between prime(k)^2 and prime(k+1)^2, a(n) = k. An exception is made for 3 to fit the usual presentation of the sieve, according to which 3 is classified as prime after the first step, that is, a(3) = 1 (it can be argued, though, that running the first step of the sieve is not actually necessary to identify 3 as prime because 3 < prime(1)^2: see the comment on A000040 by Daniel Forgues, referring to 2 and 3 as "forcibly prime" since there are no integers greater than 1 and less than or equal to their respective square roots).

Examples

			By convention, a(1)=a(2)=0, as 1 is not involved in the sieve, and 2 is known as prime before the first step (first integer > 1).
At step 1, multiples of 2 are removed, beginning with 4 = 2*2; 5 and 7 are not removed and cannot be removed at any further step because they are less than 3*3 = 9; therefore, integers from 4 to 8 are all classified as prime or not prime after the first step: a(4) = a(5) = a(6) = a(7) = a(8) = 1.
At step 2, all integers < 5^2 = 25 will be classified because those >= 9 and not already classified at step one are either multiple of 3 or prime; therefore, for 9 <= n < 25, a(n) = 1 if n is even, a(n) = 2 if n is odd.
		

Crossrefs

Formula

a(n) = A010051(n)*(A056811(n) + mod(n^2,3))+(1-A010051(n))*A055396(n)
(that is, if n is prime > 3, a(n) = primepi(firstprimebelow(sqrt(n)); else if n is composite, a(n) = A055396(n)).
a(n) = A055399(n) - A010051(n)*mod(n^2,3).

A372135 Nonsquarefree numbers not in A225353; equivalently, nonsquarefree numbers in A225354.

Original entry on oeis.org

12, 60, 84, 132, 156, 204, 228, 276, 348, 372, 420, 444, 492, 516, 564, 636, 660, 708, 732, 780, 804, 852, 876, 924, 948, 996, 1020, 1068, 1092, 1140, 1164, 1212, 1236, 1284, 1308, 1356, 1380, 1428, 1524, 1540, 1572, 1596, 1644, 1668, 1716, 1740, 1788, 1812, 1820
Offset: 1

Views

Author

Miles Englezou, Apr 20 2024

Keywords

Comments

Every number in A225353 is nonsquarefree. a(n) corresponds to those numbers which are nonsquarefree yet contain at least one partition into distinct squarefree divisors.
Verified up to a(26) = 996: except for 12, a(n) is also the order of a finite group G for which |Out(G)|<|G| for all isomorphism classes of G where the order of G is nonsquarefree. |Out(G)|<|G| for all isomorphism classes of groups with squarefree order in the same range.
If k is a term, then so is m * k where m is squarefree and coprime to k. - Robert Israel, Apr 21 2024
Comparison with other similar sequences:
For values up to and including a(2000)=76044:
b(n): | 12*A276378| 12*A007310| 12*A038179| 4*A243128| A357686
--------------------------------------------------------------------------------
# a(n) not in b(n) | 73| 70| 74| 0| 1
# b(n) not in a(n) | 0| 186| 188| 69| 69
First a(n) not in b(n)| a(40)=1540| a(40)=1540| a(1)=12| - | a(1)=12
First b(n) not in a(n)| - | 12*b(9)=300| 12*b(1)=24| 4*b(5)=140| b(4)=140

Examples

			12 is a term since 12 = 2^2*3 and 12 = 1 + 2 + 3 + 6.
		

Crossrefs

Cf. A005117 (squarefree numbers), A013929 (nonsquarefree numbers), A225353, A225354, A007310, A038179, A243128, A276378, A357686.

Programs

  • Maple
    filter:= proc(n) local P,z,d;
      if numtheory:-issqrfree(n) then return false fi;
      P:= mul(1+z^d, d = select(numtheory:-issqrfree,numtheory:-divisors(n)));
      coeff(P,z,n) > 0
    end proc:
    select(filter, [$1..2000]); # Robert Israel, Apr 21 2024
  • Mathematica
    filter[n_] := Module[{P, z, d},
       If[SquareFreeQ[n], Return[False]];
       P = Product[1 + z^d, {d, Select[Divisors[n], SquareFreeQ]}];
       Coefficient[P, z, n] > 0];
    Select[Range[2000], If[filter[#], Print[#]; True, False]&] (* Jean-François Alcover, May 28 2024, after Robert Israel *)

Formula

Equals A013929\A225353 and also A225354\A005117.
Previous Showing 11-17 of 17 results.