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-20 of 11566 results. Next

A058698 a(n) = p(P(n)), P = primes (A000040), p = partition numbers (A000041).

Original entry on oeis.org

2, 3, 7, 15, 56, 101, 297, 490, 1255, 4565, 6842, 21637, 44583, 63261, 124754, 329931, 831820, 1121505, 2679689, 4697205, 6185689, 13848650, 23338469, 49995925, 133230930, 214481126, 271248950, 431149389, 541946240, 851376628, 3913864295, 5964539504, 11097645016
Offset: 1

Views

Author

N. J. A. Sloane, Dec 31 2000

Keywords

Comments

Number of partitions of n-th prime. - Omar E. Pol, Aug 05 2011

Examples

			a(2) = 3 because the second prime is 3 and there are three partitions of 3: {1, 1, 1}, {1, 2}, {3}.
		

Crossrefs

Programs

  • Haskell
    import Data.MemoCombinators (memo2, integral)
    a058698 n = a058698_list !! (n-1)
    a058698_list = map (pMemo 1) a000040_list where
       pMemo = memo2 integral integral p
       p _ 0 = 1
       p k m | m < k     = 0
             | otherwise = pMemo k (m - k) + pMemo (k + 1) m
    -- Reinhard Zumkeller, Aug 09 2015
  • Mathematica
    Table[PartitionsP[Prime[n]], {n, 30}] (* Vladimir Joseph Stephan Orlovsky, Dec 05 2008 *)

Formula

a(n) = A000041(A000040(n)). - Omar E. Pol, Aug 05 2011

A246281 Numbers k for which A003961(k) < 2*k; Numbers n such that if n = product_{k >= 1} (p_k)^(c_k), then product_{k >= 1} (p_{k+1})^(c_k) < 2*n, where p_k indicates the k-th prime, A000040(k).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 22, 23, 25, 26, 29, 31, 33, 34, 37, 38, 41, 43, 46, 47, 51, 53, 55, 58, 59, 61, 62, 65, 67, 71, 73, 74, 77, 79, 82, 83, 85, 86, 87, 89, 93, 94, 95, 97, 101, 103, 106, 107, 109, 111, 113, 115, 118, 119, 121, 122, 123, 127, 129, 131, 133, 134, 137, 139
Offset: 1

Views

Author

Antti Karttunen, Aug 24 2014

Keywords

Comments

Numbers n such that A003961(n) < 2*n.
Numbers n such that A048673(n) <= n.
All primes (A000040) are members. (Cf. Bertrand's postulate).
All terms are deficient (in A005100). See A286385. - Antti Karttunen, Aug 27 2020

Examples

			1 is present, as 1 = empty product and 1 < 2.
2 = p_1 is in the sequence, as p_2 = 3 and 3/2 < 2.
4 = p_1 * p_1 is not a member, as p_2 * p_2 = 3*3 = 9, and 9/4 > 2.
22 = 2*11 = p_1 * p_5 is a member, as p_2 * p_6 = 39, and 39/22 < 2.
		

Crossrefs

Complement: A246282.
Union of A246351 and A048674.
Subsequence: A000040.
Subsequence of A005100.
Positions of zeros in A252742, in A336836, and in A337345.
Positions of negative terms in A252748.

Programs

  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i,1] = nextprime(f[i,1]+1)); factorback(f);
    isA246281(n) = (A003961(n) < (n+n));
    n = 0; i = 0; while(i < 10000, n++; if(isA246281(n), i++; write("b246281.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A246281 (MATCHING-POS 1 1 (lambda (n) (<= (A048673 n) n))))

Extensions

A new shorter version of name prepended by Antti Karttunen, Aug 27 2020

A037019 Let n = p_1*p_2*...*p_k be the prime factorization of n, with the primes sorted in descending order. Then a(n) = 2^(p_1 - 1)*3^(p_2 - 1)*...*A000040(k)^(p_k - 1).

Original entry on oeis.org

1, 2, 4, 6, 16, 12, 64, 30, 36, 48, 1024, 60, 4096, 192, 144, 210, 65536, 180, 262144, 240, 576, 3072, 4194304, 420, 1296, 12288, 900, 960, 268435456, 720, 1073741824, 2310, 9216, 196608, 5184, 1260, 68719476736, 786432, 36864, 1680, 1099511627776
Offset: 1

Views

Author

Keywords

Comments

This is an easy way to produce a number with exactly n divisors and it usually produces the smallest such number (A005179(n)). The references call n "ordinary" if A005179(n) = a(n) and "exceptional" or "extraordinary" otherwise. - David Wasserman, Jun 12 2002

Examples

			12 = 3*2*2, so a(12) = 2^2*3*5 = 60.
		

Crossrefs

Cf. A005179, A000040, A072066 (exceptional (or extraordinary) numbers).
Cf. A027746.

Programs

  • Haskell
    a037019 = product .
       zipWith (^) a000040_list . reverse . map (subtract 1) . a027746_row
    -- Reinhard Zumkeller, Nov 25 2012
    
  • Maple
    a:= n-> (l-> mul(ithprime(i)^(l[i]-1), i=1..nops(l)))(
            sort(map(i-> i[1]$i[2], ifactors(n)[2]), `>`)):
    seq(a(n), n=1..60);  # Alois P. Heinz, Feb 28 2019
  • Mathematica
    (Times@@(Prime[ Range[ Length[ # ] ] ]^Reverse[ #-1 ]))&@Flatten[ FactorInteger[ n ]/.{ a_Integer, b_}:>Table[ a, {b} ] ]
  • PARI
    A037019(n,p=1)=prod(i=1,#f=Vecrev(factor(n)~),prod(j=1,f[i][2],(p=nextprime(p+1))^(f[i][1]-1))) \\ M. F. Hasler, Oct 14 2014
    
  • Python
    from math import prod
    from sympy import factorint, prime
    def a(n):
        pf = factorint(n, multiple=True)
        return prod(prime(i)**(pi-1) for i, pi in enumerate(pf[::-1], 1))
    print([a(n) for n in range(1, 42)]) # Michael S. Branicky, Jul 24 2022

Extensions

More terms from David Wasserman, Jun 12 2002

A128677 Least k>p such that (kp)^3 divides (p-1)^(kp)^2+1 for prime p = A000040(n).

Original entry on oeis.org

19, 41, 29, 23, 79, 41617, 20939, 47, 40427, 4093, 4441, 2543, 1033, 659, 2612032921, 394502321, 14958421, 17957, 569, 14747, 12641, 167, 174263, 100493, 285629
Offset: 2

Views

Author

Alexander Adamchuk, Mar 30 2007, Mar 31 2007, Apr 09 2007

Keywords

Comments

For every prime p>2, p^3 divides (p-1)^(p^2)+1 and furthermore p divides all numbers n>1 such that n^3 divides (p-1)^(n^2)+1.
a(27)>10^15. - Max Alekseyev, Nov 30 2017
Some further terms: a(28)-a(36) = {857, 3271, 7243979, 509, 263, 43019, 38921, 2683, 312055091}. a(38)-a(43) = {7499, 88588425539, 9689, 359, 1087, 383}. a(45)-a(61) = {931417, 40597, 2111, 2677, 14983, 261061, 1302937, 479, 17935703, 503, 4227137, 39398453, 2153, 1627, 1109, 28663, 1699}. a(63)-a(69) = {1229, 1867, 78877, 500861, 1987, 62683, 2777}. a(71)-a(75) = {275884327, 719, 44041, 3122698559, 15161}. a(77)-a(80) = {907927, 202471, 5788837, 16361}.
a(n) <= A177996(n).
A000040(n) divides (a(n) - 1)/2. The quotients (a(n)-1)/2/A000040(n) are listed in A136374.

Examples

			a(2) = A127263(3)/3 = 57/3 = 19.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p, k}, p = Prime[n]; k = p + 1;
       While[! Divisible[(p - 1)^(k p)^2 + 1, (k p)^3], k++]; k];
    Table[a[n], {n, 2, 15}] (* Robert Price, Mar 23 2020 *)

Formula

a(n) = smallest prime divisor of (p-1)^(p^2)+1 other than p, where p=A000040(n).

Extensions

a(16)-a(26), a(39), a(74) from Max Alekseyev, May 16 2010

A246377 Permutation of natural numbers: a(1) = 1, a(p_n) = 2*a(n)+1, a(c_n) = 2*a(n), where p_n = n-th prime = A000040(n), c_n = n-th composite number = A002808(n).

Original entry on oeis.org

1, 3, 7, 2, 15, 6, 5, 14, 4, 30, 31, 12, 13, 10, 28, 8, 11, 60, 29, 62, 24, 26, 9, 20, 56, 16, 22, 120, 61, 58, 63, 124, 48, 52, 18, 40, 25, 112, 32, 44, 27, 240, 21, 122, 116, 126, 57, 248, 96, 104, 36, 80, 17, 50, 224, 64, 88, 54, 23, 480, 121, 42, 244, 232, 252, 114, 59, 496, 192, 208, 125, 72, 49, 160, 34, 100
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2014

Keywords

Comments

This permutation is otherwise like Katarzyna Matylla's A135141, except that the role of even and odd numbers (or alternatively: primes and composites) has been swapped.
Because 2 is the only even prime, it implies that, apart from a(2)=3, odd numbers occur in odd positions only (along with many even numbers that also occur in odd positions).
This also implies that for each odd composite (A071904) there exists a separate infinite cycle in this permutation, apart from 9 and 15 which are in the same infinite cycle: (..., 23, 9, 4, 2, 3, 7, 5, 15, 28, 120, 82, 46, ...).

Crossrefs

Inverse: A246378.
Other related or similar permutations: A135141, A054429, A246201, A245703, A246376, A246379, A243071, A246681, A236854.
Differs from A237427 for the first time at n=19, where a(19) = 29, while A237427(19) = 62.

Formula

a(1) = 1, and for n > 1, if A010051(n) = 1 [i.e. when n is a prime], a(n) = 1+(2*a(A000720(n))), otherwise a(n) = 2*a(A065855(n)).
As a composition of related permutations:
a(n) = A054429(A135141(n)).
a(n) = A135141(A236854(n)).
a(n) = A246376(A246379(n)).
a(n) = A246201(A245703(n)).
a(n) = A243071(A246681(n)). [For n >= 1].
Other identities.
For all n > 1 the following holds:
A000035(a(n)) = A010051(n). [Maps primes to odd numbers > 1, and composites to even numbers, in some order. Permutations A246379 & A246681 have the same property].

A024697 a(n) = p(1)p(n) + p(2)p(n-1) + ... + p(k)p(n+1-k), where k = [ (n+1)/2 ], p = A000040 = the primes.

Original entry on oeis.org

4, 6, 19, 29, 68, 94, 177, 231, 400, 484, 753, 903, 1340, 1552, 2157, 2489, 3352, 3784, 5013, 5515, 7052, 7758, 9773, 10575, 13076, 14076, 17023, 18339, 21876, 23414, 27715, 29437, 34570, 36500, 42335, 44731, 51560, 54198, 61955, 65051, 73700, 77402, 87293
Offset: 1

Views

Author

Keywords

Comments

a(n) = A025129(n) for even n. - M. F. Hasler, Apr 06 2014

Crossrefs

Programs

  • Haskell
    a024697 n = a024697_list !! (n-1)
    a024697_list = f (tail a000040_list) [head a000040_list] 2 where
       f (p:ps) qs k = sum (take (div k 2) $ zipWith (*) qs $ reverse qs) :
                       f ps (p : qs) (k + 1)
    -- Reinhard Zumkeller, Apr 07 2014
  • Maple
    A024697:=n->sum( ithprime(k)*ithprime(n-k+1), k=1..(n+1)/2 ); seq(A024697(n), n=1..50); # Wesley Ivan Hurt, Apr 06 2014
  • Mathematica
    Table[Sum[Prime[k] Prime[n - k + 1], {k, (n + 1)/2}], {n, 50}] (* Wesley Ivan Hurt, Apr 06 2014 *)
  • PARI
    A024697(n)=sum(k=1, (n+1)\2, prime(k)*prime(n-k+1)) \\ M. F. Hasler, Apr 06 2014
    

Extensions

Name edited and values double-checked by M. F. Hasler, Apr 06 2014

A256236 Smallest b > 1 such that the first n primes p (i.e., A000040(1)-A000040(n)) all satisfy b^(p-1) == 1 (mod p^2), i.e., smallest base b larger than 1 such that any member of the set of first n primes is a base-b Wieferich prime.

Original entry on oeis.org

5, 17, 449, 557, 19601, 132857, 4486949, 126664001, 2363321449, 5229752849, 2486195039249, 16250570614349, 83322586961893, 39699586259362801, 8042447016668335049, 449320365877347849601, 4376479338174582826793
Offset: 1

Views

Author

Felix Fröhlich, Mar 25 2015

Keywords

Comments

There might be bases b where prime(n+1) is also a base-b Wieferich prime. This does not affect the membership of b in the sequence.
Are there any terms such that a(n) = a(n+1)?
Does b exist for all n?
All currently known terms satisfy a(n) >= A255901(n). Are there any terms such that a(n) < A255901(n)?
If it exists, a(12) > 6*10^12. - Robert Price, Oct 10 2019
a(n) <= prime(n)#^2+1 = A189409(n), since any prime p is a Wieferich prime in base k*p^2+1 for all k. - Jens Kruse Andersen, Dec 20 2020

Examples

			Values of bases b and the values of first Wieferich primes p to base b:
b             | p
-------------------------------------------------------------------------
5             | 2, 20771, 40487 ...
17            | 2, 3, 46021, 48947 ...
449           | 2, 3, 5, 1789 ...
557           | 2, 3, 5, 7, 23, 39829 ...
19601         | 2, 3, 5, 7, 11, 23, 47 ...
132857        | 2, 3, 5, 7, 11, 13, 73, 257 ...
4486949       | 2, 3, 5, 7, 11, 13, 17, 89, 197 ...
126664001     | 2, 3, 5, 7, 11, 13, 17, 19, 101, 2789 ...
2363321449    | 2, 3, 5, 7, 11, 13, 17, 19, 23 ...
5229752849    | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 881, 2246969 ...
2486195039249 | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 ...
		

Crossrefs

Cf. A255901.

Programs

  • Mathematica
    b = 2; Table[While[fnd = True;
      For[i = 1, i <= n, i++,
       p = Prime[i];
       If[PowerMod[b, (p - 1), p^2] != 1 , fnd = False;  Break[]]];
    b++; ! fnd]; b - 1, {n, 5}] (* Robert Price, Oct 10 2019 *)
  • PARI
    a(n) = my(v=primes(n)); for(b=2, oo, for(k=1, #v, if(Mod(b, v[k]^2)^(v[k]-1)!=1, break, if(k==#v, return(b)))))

Extensions

a(9)-a(11) from Robert Price, Oct 10 2019
a(12)-a(17) from Jens Kruse Andersen, Dec 28 2020

A080148 Positions of primes of the form 4*k+3 (A002145) among all primes (A000040).

Original entry on oeis.org

2, 4, 5, 8, 9, 11, 14, 15, 17, 19, 20, 22, 23, 27, 28, 31, 32, 34, 36, 38, 39, 41, 43, 46, 47, 48, 49, 52, 54, 56, 58, 61, 63, 64, 67, 69, 72, 73, 75, 76, 81, 83, 85, 86, 90, 91, 92, 93, 94, 95, 96, 99, 101, 103, 105, 107, 109, 111, 114, 115, 117, 118, 120, 124, 125, 128
Offset: 1

Views

Author

Antti Karttunen, Feb 11 2003

Keywords

Comments

It appears that a(n) = k such that binomial(prime(k),3) mod 2 = 1. See Maple code. - Gary Detlefs, Dec 06 2011
The above is correct (work mod 4). - Charles R Greathouse IV, Dec 06 2011
The asymptotic density of this sequence is 1/2 (by Dirichlet's theorem). - Amiram Eldar, Mar 01 2021

Crossrefs

Almost complement of A080147 (1 is excluded from both).

Programs

Formula

a(n) = A049084(A002145(n)). - R. J. Mathar, Oct 06 2008

A112049 a(n) = position of A112046(n) in A000040.

Original entry on oeis.org

1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 4, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 4, 5, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 6, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 4, 3, 1, 1, 2, 2, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

A112051 gives the first positions of distinct new values in this sequence, that seem also to be the positions of the first occurrence of each n, and thus the positions of the records. Compare also to A084921. - Antti Karttunen, May 26 2017

Crossrefs

Cf. A286579 (ordinal transform).

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1},While[JacobiSymbol[i, 2n + 1]==1, i++]; i];a049084[n_]:=If[PrimeQ[n], PrimePi[n], 0]; Table[a049084[a112046[n]], {n, 102}] (* Indranil Ghosh, May 11 2017 *)
  • PARI
    A112049(n) = for(i=1, (2*n), if((kronecker(i, (n+n+1)) < 1), return(primepi(i)))); \\ Antti Karttunen, May 26 2017
    
  • Python
    from sympy import jacobi_symbol as J, isprime, primepi
    def a049084(n):
        return primepi(n) if isprime(n) else 0
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a(n): return a049084(a112046(n))
    print([a(n) for n in range(1, 103)]) # Indranil Ghosh, May 11 2017

Formula

a(n) = A049084(A112046(n)).

Extensions

Unnecessary fallback-clause removed from the name by Antti Karttunen, May 26 2017

A242424 Bulgarian solitaire operation on partition list A112798: a(1) = 1, a(n) = A000040(A001222(n)) * A064989(n).

Original entry on oeis.org

1, 2, 4, 3, 6, 6, 10, 5, 12, 9, 14, 10, 22, 15, 18, 7, 26, 20, 34, 15, 30, 21, 38, 14, 27, 33, 40, 25, 46, 30, 58, 11, 42, 39, 45, 28, 62, 51, 66, 21, 74, 50, 82, 35, 60, 57, 86, 22, 75, 45, 78, 55, 94, 56, 63, 35, 102, 69, 106, 42, 118, 87, 100, 13, 99, 70, 122, 65
Offset: 1

Views

Author

Antti Karttunen, May 13 2014

Keywords

Comments

In "Bulgarian solitaire" a deck of cards or another finite set of objects is divided into one or more piles, and the "Bulgarian operation" is performed by taking one card from each pile, and making a new pile of them, which is added to the remaining set of piles. Essentially, this operation is a function whose domain and range are unordered integer partitions (cf. A000041) and which preserves the total size of a partition (the sum of its parts). This sequence is induced when the operation is implemented on the partitions as ordered by the list A112798.
Please compare to the definition of A122111, which conjugates the partitions encoded with the same system.
a(n) is even if and only if n is either a prime or a multiple of three.
Conversely, a(n) is odd if and only if n is a nonprime not divisible by three.

References

  • Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.

Crossrefs

Row 1 of A243070 (table which gives successive "recursive iterates" of this sequence and converges towards A122111).
Fixed points: A002110 (primorial numbers).

Programs

Formula

a(1) = 1, a(n) = A000040(A001222(n)) * A064989(n) = A105560(n) * A064989(n).
a(n) = A241909(A243051(A241909(n))).
a(n) = A243353(A226062(A243354(n))).
a(A000079(n)) = A000040(n) for all n.
A056239(a(n)) = A056239(n) for all n.
Previous Showing 11-20 of 11566 results. Next