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 10 results.

A001751 Primes together with primes multiplied by 2.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 10, 11, 13, 14, 17, 19, 22, 23, 26, 29, 31, 34, 37, 38, 41, 43, 46, 47, 53, 58, 59, 61, 62, 67, 71, 73, 74, 79, 82, 83, 86, 89, 94, 97, 101, 103, 106, 107, 109, 113, 118, 122, 127, 131, 134, 137, 139, 142, 146, 149, 151, 157, 158, 163, 166
Offset: 1

Views

Author

Keywords

Comments

For n > 1, a(n) is position of primes in A026741.
For n > 1, a(n) is the position of the ones in A046079. - Ant King, Jan 29 2011
A251561(a(n)) != a(n). - Reinhard Zumkeller, Dec 27 2014
Number of terms <= n is pi(n) + pi(n/2). - Robert G. Wilson v, Aug 04 2017
Number of terms <=10^k: 7, 40, 263, 1898, 14725, 120036, 1013092, 8762589, 77203401, 690006734, 6237709391, 56916048160, 523357198488, 4843865515369, ..., . - Robert G. Wilson v, Aug 04 2017
Complement of A264828. - Chai Wah Wu, Oct 17 2024

Crossrefs

Union of A001747 and A000040.
Subsequence of A039698 and of A033948.

Programs

  • Haskell
    a001751 n = a001751_list !! (n-1)
    a001751_list = 2 : filter (\n -> (a010051 $ div n $ gcd 2 n) == 1) [1..]
    -- Reinhard Zumkeller, Jun 20 2011 (corrected, improved), Dec 17 2010
    
  • Mathematica
    Select[Range[163], Or[PrimeQ[#], PrimeQ[1/2 #]] &] (* Ant King, Jan 29 2011 *)
    upto=200;With[{pr=Prime[Range[PrimePi[upto]]]},Select[Sort[Join[pr,2pr]],# <= upto&]] (* Harvey P. Dale, Sep 23 2014 *)
  • PARI
    isA001751(n)=isprime(n/gcd(n,2)) || n==2
    
  • PARI
    list(lim)=vecsort(concat(primes(primepi(lim)), 2* primes(primepi(lim\2)))) \\ Charles R Greathouse IV, Oct 31 2012
    
  • Python
    from sympy import primepi
    def A001751(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 int(n+x-primepi(x)-primepi(x>>1))
        return bisection(f,n,n) # Chai Wah Wu, Oct 17 2024

A061743 Numbers k such that k! is divisible by (k+1)^2.

Original entry on oeis.org

11, 14, 15, 17, 19, 20, 23, 24, 26, 27, 29, 31, 32, 34, 35, 38, 39, 41, 43, 44, 47, 48, 49, 50, 51, 53, 54, 55, 56, 59, 62, 63, 64, 65, 67, 68, 69, 71, 74, 75, 76, 77, 79, 80, 83, 84, 86, 87, 89, 90, 91, 92, 94, 95, 97, 98, 99, 101, 103, 104, 107, 109, 110, 111, 113, 114
Offset: 1

Views

Author

Robert G. Wilson v, Jun 21 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[120], IntegerQ[ #!/(# + 1)^2] &]
  • PARI
    { n=0; f=1; for (a=1, 2588, f*=a; if (f%(a + 1)^2 == 0, write("b061743.txt", n++, " ", a)) ) } \\ Harry J. Smith, Jul 27 2009
    
  • PARI
    isok(k) = !(k! % (k+1)^2); \\ Michel Marcus, Jul 01 2018
    
  • Python
    from sympy import primepi
    def A061743(n):
        def f(x): return int(n+2+primepi(x+1)+primepi(x+1>>1))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 17 2024

Formula

a(n) = A264828(n+3)-1. Complement of {A178156} - 1. - Chai Wah Wu, Oct 17 2024

A332672 Number of non-unimodal permutations of a multiset whose multiplicities are the prime indices of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 6, 0, 0, 6, 16, 0, 21, 0, 12, 10, 0, 0, 48, 16, 0, 81, 20, 0, 48, 0, 104, 15, 0, 30, 162, 0, 0, 21, 104, 0, 90, 0, 30, 198, 0, 0, 336, 65, 124, 28, 42, 0, 603, 50, 190, 36, 0, 0, 396, 0, 0, 405, 688, 77, 150, 0, 56, 45, 260, 0
Offset: 1

Views

Author

Gus Wiseman, Feb 23 2020

Keywords

Comments

This multiset is generally not the same as the multiset of prime indices of n. For example, the prime indices of 12 are {1,1,2}, while a multiset whose multiplicities are {1,1,2} is {1,1,2,3}.
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.

Examples

			The a(n) permutations for n = 8, 9, 12, 15, 16:
  213   1212   1213   11212   1324
  312   2112   1312   12112   1423
        2121   2113   12121   2134
               2131   21112   2143
               3112   21121   2314
               3121   21211   2413
                              3124
                              3142
                              3214
                              3241
                              3412
                              4123
                              4132
                              4213
                              4231
                              4312
		

Crossrefs

Positions of zeros are one and A001751.
Support is A264828 without one.
Dominated by A318762.
The complement is counted by A332294.
A less interesting version is A332671.
The opposite version is A332742.
Unimodal compositions are A001523.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.
Heinz numbers of partitions with non-unimodal run-lengths are A332282.
Compositions whose negation is not unimodal are A332669.

Programs

  • Mathematica
    nrmptn[n_]:=Join@@MapIndexed[Table[#2[[1]],{#1}]&,If[n==1,{},Flatten[Cases[FactorInteger[n]//Reverse,{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    Table[Length[Select[Permutations[nrmptn[n]],!unimodQ[#]&]],{n,30}]

Formula

a(n) = A332671(A181821(n)).
a(n) + A332294(n) = A318762(n).

A009188 Short leg of more than one Pythagorean triangle.

Original entry on oeis.org

9, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 33, 35, 36, 39, 40, 42, 44, 45, 48, 49, 50, 51, 52, 54, 55, 56, 57, 60, 63, 64, 65, 66, 68, 69, 70, 72, 75, 76, 77, 78, 80, 81, 84, 85, 87, 88, 90, 91, 92, 93, 95, 96, 98, 99, 100, 102, 104, 105, 108, 110, 111, 112, 114, 115, 116
Offset: 1

Views

Author

Keywords

Comments

Values of n for which composite n X n magic squares are possible. - J. Lowell, May 20 2010
If n is in the sequence, k*n is in the sequence for all k > 1. So odd semiprimes (A046315) and numbers of the form 4*p where p is an odd prime are core subsequences which give the initial terms of arithmetic progressions in this sequence. - Altug Alkan, Nov 29 2015
Numbers appearing more than once in A009004. - Sean A. Irvine, Apr 20 2018

Crossrefs

Programs

  • Maple
    filter:= proc(n) not isprime(n) and (n::odd or not isprime(n/2)) end proc:
    select(filter, [$9 .. 10000]); # Robert Israel, Nov 30 2015
  • Mathematica
    filterQ[n_] := !PrimeQ[n] && (OddQ[n] || !PrimeQ[n/2]);
    Select[Range[9, 120], filterQ] (* Jean-François Alcover, Feb 28 2019, from Maple *)
  • PARI
    forcomposite(n=9, 1e3, if(n % 2 == 1 || !isprime(n/2), print1(n, ", "))) \\ Altug Alkan, Dec 01 2015
    
  • Python
    from sympy import primepi
    def A009188(n):
        def f(x): return int(n+2+primepi(x)+primepi(x>>1))
        m, k = n+2, f(n+2)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 17 2024

Formula

a(n) = A264828(n+2). - Chai Wah Wu, Oct 17 2024

A265128 Nonprimes excluding numbers of the forms 2*p and p^i where p is a prime and i is a positive integer.

Original entry on oeis.org

0, 1, 12, 15, 18, 20, 21, 24, 28, 30, 33, 35, 36, 39, 40, 42, 44, 45, 48, 50, 51, 52, 54, 55, 56, 57, 60, 63, 65, 66, 68, 69, 70, 72, 75, 76, 77, 78, 80, 84, 85, 87, 88, 90, 91, 92, 93, 95, 96, 98, 99, 100, 102, 104, 105, 108, 110, 111, 112, 114, 115, 116
Offset: 1

Views

Author

Giovanni Teofilatto, Dec 02 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range@ 120, And[! PrimeQ@ #, Nand[EvenQ@ #, PrimeQ[#/2]], ! PrimePowerQ@ #] &] (* Michael De Vlieger, Dec 02 2015 *)
  • PARI
    isok(n) = ! (isprime(n) || (! (n%2) && isprime(n/2)) || isprimepower(n)); \\ Michel Marcus, Dec 02 2015

A348788 Values of A347113(k) for k in A348787.

Original entry on oeis.org

1, 12, 15, 18, 24, 30, 27, 32, 36, 40, 42, 44, 48, 56, 50, 54, 60, 63, 66, 64, 70, 65, 68, 72, 69, 75, 78, 76, 84, 80, 87, 77, 81, 88, 91, 90, 98, 93, 92, 96, 100, 105, 102, 99, 104, 108, 110, 114, 120, 132, 112, 115, 124, 130, 119, 123, 126, 125, 128, 135, 138, 129, 136, 140, 144, 150, 141, 147, 152, 156, 148, 153, 160, 154, 162, 155
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2021

Keywords

Comments

By definition, the points (A348787(k), a(k)) form the main diagonal of A347113.
It appears that apart from a very small number of exceptions this sequence consists of the numbers that are neither primes nor twice primes (A264828).
The known exceptions (based on the first 20000 terms) are: (a) the three primes A347113(1423) = 1327, A347113(10686) = 9967, and A347113(83051) = 77647 that are unusually close to the line y=x, and (b) the 27 terms [8, 9, 16, 20, 21, 25, 28, 33, 35, 39, 45, 49, 51, 52, 55, 57, 85, 95, 111, 116, 117, 121, 133, 143, 145, 169, 187] which are in A264828 but are not in the present sequence.
This list of 27 exceptions is surprisingly similar to A181780, but this may be just a coincidence.

Crossrefs

A271345 Integers n such that (n-1)! is divisible by n^3.

Original entry on oeis.org

1, 12, 18, 20, 24, 27, 28, 30, 32, 35, 36, 40, 42, 44, 45, 48, 49, 50, 52, 54, 55, 56, 60, 63, 64, 65, 66, 68, 70, 72, 75, 76, 77, 78, 80, 81, 84, 85, 88, 90, 91, 92, 95, 96, 98, 99, 100, 102, 104, 105, 108, 110, 112, 114, 115, 116, 117, 119, 120, 121, 124, 125, 126, 128, 130, 132, 133, 135
Offset: 1

Views

Author

Altug Alkan, Apr 04 2016

Keywords

Comments

Integers n such that A000142(n-1) is divisible by A000578(n).
Obviously, all terms are nonprime.
For n > 1, members of this sequence are short leg of more than one Pythagorean triangle.

Examples

			12 is a term because 11! is divisible 12^3.
		

Crossrefs

Programs

  • PARI
    lista(nn) = for(n=1, nn, if((n-1)! % (n^3) == 0, print1(n, ", ")));

A355462 Powerful numbers divisible by exactly 2 distinct primes.

Original entry on oeis.org

36, 72, 100, 108, 144, 196, 200, 216, 225, 288, 324, 392, 400, 432, 441, 484, 500, 576, 648, 675, 676, 784, 800, 864, 968, 972, 1000, 1089, 1125, 1152, 1156, 1225, 1296, 1323, 1352, 1372, 1444, 1521, 1568, 1600, 1728, 1936, 1944, 2000, 2025, 2116, 2304, 2312, 2500
Offset: 1

Views

Author

Amiram Eldar, Jul 03 2022

Keywords

Comments

First differs from A286708 at n = 25.
Number of the form p^i * q^j, where p != q are primes and i,j > 1.
Numbers k such that A001221(k) = 2 and A051904(k) >= 2.
The possible values of the number of the divisors (A000005) of terms in this sequence is any composite number that is not 8 or twice a prime (A264828 \ {1, 8}).
675 = 3^3*5^2 and 676 = 2^2*13^2 are 2 consecutive integers in this sequence. There are no other such pairs below 10^22 (the lesser members of such pairs are terms of A060355).

Examples

			36 is a term since 36 = 2^2 * 3^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2500], Length[(e = FactorInteger[#][[;; , 2]])] == 2 && Min[e] > 1 &]
  • PARI
    is(n) = {my(f=factor(n)); #f~ == 2 && vecmin(f[,2]) > 1};

Formula

Sum_{n>=1} 1/a(n) = ((Sum_{p prime} (1/(p*(p-1))))^2 - Sum_{p prime} (1/(p^2*(p-1)^2)))/2 = 0.1583860791... .

A370759 Numbers expressible in the form k*m + 2*(k+m) - 1, for positive k and m.

Original entry on oeis.org

4, 7, 10, 11, 13, 15, 16, 19, 20, 22, 23, 25, 27, 28, 30, 31, 34, 35, 37, 39, 40, 43, 44, 45, 46, 47, 49, 50, 51, 52, 55, 58, 59, 60, 61, 63, 64, 65, 67, 70, 71, 72, 73, 75, 76, 79, 80, 82, 83, 85, 86, 87, 88, 90, 91, 93, 94, 95, 97, 99, 100, 103, 105, 106, 107, 109, 110, 111, 112
Offset: 1

Views

Author

Nicolay Avilov, Mar 01 2024

Keywords

Comments

All such numbers are answers to the question: How many plane regions result from partitioning by two sets of straight lines, such that:
Each of the k straight lines of the first bundle passes though a single point A, and intersects each of the m straight lines of the second bundle each of which passes through a different point B. There are no straight lines belonging to both bundles, i.e. the line AB is not involved.
Because k*m+2*(k+m)-1 = (k+2)*(m+2)-5, and k and m are both positive, a(n) = A264828(n+2) - 5. - Kevin Ryde, Mar 26 2024

Examples

			4 is a term: if each bundle consists of one straight line, the plane is divided into 4 regions.
7 is a term: if the first bundle consists of one line and the second consists of two lines, the plane is divided into 7 regions.
These and other examples are illustrated in the linked figures.
		

Crossrefs

Cf. A264828, A028875 (case when k=m).

Programs

  • PARI
    print(Vec(setbinop((k,m)->k*m + 2*(k + m) - 1, [1..112]), 69)) \\ Michel Marcus, Mar 02 2024
    
  • Python
    maxval = 112
    av = [[k*m+2*k+2*m-1 for k in range(1,maxval)] for m in range(1,maxval)]
    flat = [n for row in av for n in row]
    uniq = list(set(flat))
    a370759 = list(filter(lambda x: x<=maxval, uniq))
    print(a370759)
    # Robert Munafo, Mar 25 2024
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A370759_gen(startvalue=4): # generator of terms >= startvalue
        return filter(lambda n:not (isprime(n+5) or (n&1 and isprime((n>>1)+3))),count(max(startvalue,4)))
    A370759_list = list(islice(A370759_gen(),20)) # Chai Wah Wu, Mar 26 2024

Formula

If there are k straight lines in the first bundle and m straight lines in the second bundle, then we get k*m + 2*(k + m) - 1 regions.

A265694 a(n) = n!! mod n^2 where n!! is a double factorial number (A006882).

Original entry on oeis.org

0, 2, 3, 8, 15, 12, 7, 0, 54, 40, 110, 0, 104, 84, 0, 0, 221, 0, 342, 0, 0, 220, 506, 0, 0, 312, 0, 0, 493, 0, 930, 0, 0, 544, 0, 0, 222, 684, 0, 0, 369, 0, 1806, 0, 0, 1012, 47, 0, 0, 0, 0, 0, 1590, 0, 0, 0, 0, 1624, 59, 0, 3050, 1860, 0, 0, 0, 0, 4422, 0, 0, 0
Offset: 1

Views

Author

Altug Alkan, Dec 13 2015

Keywords

Comments

Inspired by geometric meaning of distribution of 0's in this sequence.
Position of 0's in this sequence is directly related with sequence which gives the short leg of more than one Pythagorean triangle (A009188). See comment sections in A009188 and A264828 which are the related sequences for further information.
More precisely, a(A009188(n+1)) = 0 for n > 0.

Examples

			For n = 1, a(1) = 1!! mod 1^2 = 1 mod 1 = 0.
For n = 2, a(2) = 2!! mod 2^2 = 2 mod 4 = 2.
For n = 8, a(8) = 8!! mod 8^2 = 384 mod 64 = 0.
		

Crossrefs

Cf. A006882.

Programs

  • Magma
    DoubleFactorial:=func< n | &*[n..2 by -2] >; [ DoubleFactorial(n) mod n^2: n in [1..70] ]; // Vincenzo Librandi, Dec 14 2015
  • Mathematica
    Table[Mod[n!!, n^2], {n, 70}] (* Michael De Vlieger, Dec 14 2015 *)
  • PARI
    df(n) = if( n<0, 0, my(E); E = exp(x^2 / 2 + x * O(x^n)); n! * polcoeff( 1 + E * x * (1 + intformal(1 / E)), n));
    vector(70, n, df(n) % n^2)
    

Formula

a(A009188(n+1)) = 0 for n > 0.
Showing 1-10 of 10 results.