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 41-50 of 86 results. Next

A341484 Number of ways to write n as an ordered sum of 7 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 7, 0, 7, 21, 7, 49, 42, 63, 154, 119, 259, 357, 420, 707, 861, 1169, 1666, 2072, 2752, 3703, 4557, 5999, 7637, 9422, 12089, 14931, 18354, 22904, 27825, 33866, 41328, 49539, 59753, 71386, 85071, 100800, 119455, 140448, 164794, 193179, 224826, 261464, 303422
Offset: 7

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 7):
    seq(a(n), n=7..52);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 52; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^7, {x, 0, nmax}], x] // Drop[#, 7] &

A341485 Number of ways to write n as an ordered sum of 8 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 8, 0, 8, 28, 8, 64, 64, 84, 232, 182, 400, 596, 680, 1232, 1520, 2128, 3144, 3970, 5504, 7532, 9584, 12945, 16920, 21464, 28288, 35778, 45264, 57856, 72024, 90036, 112456, 138140, 170600, 208874, 254192, 309088, 373584, 449731, 539408, 645584, 767776
Offset: 8

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 8):
    seq(a(n), n=8..51);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 51; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^8, {x, 0, nmax}], x] // Drop[#, 8] &

A341486 Number of ways to write n as an ordered sum of 9 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 9, 0, 9, 36, 9, 81, 93, 108, 333, 270, 585, 945, 1047, 2016, 2547, 3612, 5571, 7101, 10227, 14256, 18621, 25830, 34497, 44955, 60610, 78480, 101754, 133092, 169380, 217008, 276852, 347967, 439272, 549786, 683244, 849528, 1047678, 1288017, 1577934
Offset: 9

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 9):
    seq(a(n), n=9..50);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 50; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^9, {x, 0, nmax}], x] // Drop[#, 9] &

A139119 Primes whose binary representation shows the distribution of prime numbers using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

2, 37, 149, 599, 153437, 39279991, 628479869, 11056334789265976156021, 3263254052013454238294691704608897001027543, 7524551543123483484068003542235060639999919940760883731360687
Offset: 1

Views

Author

Omar E. Pol, Apr 11 2008

Keywords

Comments

Primes in A118255.
Primes whose binary representation is also the concatenation of the initial terms of A005171, the characteristic function of nonprimes. - Omar E. Pol, Oct 07 2013
a(11) is a 120-digit number 377859...798653. - Robert Price, Apr 03 2019

Crossrefs

Programs

  • Mathematica
    Select[Table[FromDigits[Boole /@ Not /@ PrimeQ /@ Range@k, 2], {k, 1, 100}], PrimeQ] (* Federico Provvedi, Oct 07 2013 *)
  • PARI
    f(n) = fromdigits(vector(n, k, !isprime(k)), 2); \\ A118255
    lista(nn) = for (n=1, nn, if (isprime(p=f(n)), print1(p, ", "))); \\ Michel Marcus, Apr 04 2019

Extensions

a(8)-a(10) from Donovan Johnson, Oct 07 2013

A191558 a(n) = 0 if n prime, otherwise n.

Original entry on oeis.org

1, 0, 0, 4, 0, 6, 0, 8, 9, 10, 0, 12, 0, 14, 15, 16, 0, 18, 0, 20, 21, 22, 0, 24, 25, 26, 27, 28, 0, 30, 0, 32, 33, 34, 35, 36, 0, 38, 39, 40, 0, 42, 0, 44, 45, 46, 0, 48, 49, 50, 51, 52, 0, 54, 55, 56, 57, 58, 0, 60, 0, 62, 63, 64, 65, 66, 0, 68, 69, 70, 0, 72, 0, 74, 75, 76, 77, 78, 0, 80, 81, 82, 0, 84, 85, 86, 87, 88, 0, 90, 91, 92, 93, 94
Offset: 1

Views

Author

Vincenzo Librandi, Jun 07 2011

Keywords

Crossrefs

Cf. A002808.

Programs

  • Magma
    [IsPrime(n) select 0 else n: n in [1..100]]; // Vincenzo Librandi, May 17 2014
  • Maple
    A191558 := proc(n) if isprime(n) then 0; else n; end if; end proc:
    seq(A191558(n),n=1..80) ; # R. J. Mathar, Jun 11 2011
  • Mathematica
    Table[If[PrimeQ[n], 0, n], {n, 150}] (* Vincenzo Librandi, May 17 2014 *)
    (*recurrence*)
    Clear[t];
    nn = 94;
    t[1, 1] = 1;
    t[n_, k_] :=
      t[n, k] =
       If[n == k, n*(1 - Product[t[n, k - i], {i, 1, k - 1}]),
        If[n > k, t[n - k, k], 1]];
    Table[t[n, n], {n, 1, nn}](* Mats Granvik, Jul 05 2014 *)
    Table[n (1 - PrimePi[n] + PrimePi[n - 1]), {n, 50}] (* Wesley Ivan Hurt, Jul 06 2014 *)

Formula

a(n) = n * A005171(n) = n - A061397(n). - R. J. Mathar, Jun 11 2011

A347788 Number of compositions (ordered partitions) of n into at most 2 nonprime parts.

Original entry on oeis.org

1, 1, 1, 0, 1, 2, 1, 2, 2, 3, 5, 2, 4, 4, 5, 5, 8, 4, 8, 6, 8, 7, 11, 6, 12, 9, 13, 9, 14, 10, 16, 12, 14, 13, 19, 13, 22, 14, 17, 17, 22, 16, 24, 18, 22, 19, 25, 18, 28, 21, 28, 21, 28, 22, 32, 25, 30, 25, 33, 26, 38, 28, 31, 29, 38, 29, 42, 30, 34, 33, 42
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 13 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,2,Select[Range@n,!PrimeQ@#&]],1],{n,0,70}] (* Giorgos Kalogeropoulos, Sep 13 2021 *)
  • PARI
    A347788(n) = if(n<2,1,!isprime(n)+sum(k=1,n-1,!(isprime(k)+isprime(n-k)))); \\ Antti Karttunen, Nov 25 2022

A051352 a(0) = 0; for n>0, a(n) = a(n-1) + n if n not prime else a(n-1) - n.

Original entry on oeis.org

0, 1, -1, -4, 0, -5, 1, -6, 2, 11, 21, 10, 22, 9, 23, 38, 54, 37, 55, 36, 56, 77, 99, 76, 100, 125, 151, 178, 206, 177, 207, 176, 208, 241, 275, 310, 346, 309, 347, 386, 426, 385, 427, 384, 428, 473, 519, 472, 520, 569, 619, 670, 722, 669, 723, 778
Offset: 0

Views

Author

Armand Turpel armandt(AT)unforgettable.com

Keywords

Comments

Sequence is not monotonic.
Difference between sum of nonprime numbers and prime numbers <= n. - Zak Seidov, Sep 27 2003

Crossrefs

Programs

  • Haskell
    a051352 n = a051352_list !! n
    a051352_list = 0 : zipWith (+)
       (a051352_list) (zipWith (*) [1..] $ map ((1 -) . (* 2)) a010051_list)
    -- Reinhard Zumkeller, Jan 02 2015
    
  • Maple
    A034387 := proc(n)
        option remember;
        if n <= 1 then
            0;
        else
            procname(n-1)+ `if`(isprime(n), n, 0)
        end if;
    end proc:
    A051352 := proc(n)
        n*(n+1)/2 - 2*A034387(n) ;
    end proc:
    seq(A051352(n),n=0..40) ; # R. J. Mathar, Jun 26 2024
  • Mathematica
    a[0]=0;a[n_]:=a[n]=If[PrimeQ[n],a[n-1]-n,a[n-1]+n]; Table[a[i], {i,0,60}] (* Harvey P. Dale, Apr 07 2011 *)
    nxt[{n_,a_}]:={n+1,If[PrimeQ[n+1],a-n-1,a+n+1]}; NestList[nxt,{0,0},60][[All,2]] (* Harvey P. Dale, Sep 07 2022 *)
  • PARI
    a(n) = my(v=primes([1, n])); n*(n+1)/2 -2*vecsum(v); \\ Michel Marcus, Jun 24 2024

Formula

a(n) = a(n-1) + n * (1 - 2*A010051(n)) = a(n-1) + n * (2*A005171(n) - 1) = a(n-1) + n * (A005171(n) - A010051(n)). - Reinhard Zumkeller, Nov 25 2009
a(n) = A000217(n) - 2*A034387(n). - Michel Marcus, Jun 24 2024

A118257 Numbers k such that A118255(k) is prime.

Original entry on oeis.org

2, 6, 8, 10, 18, 26, 30, 74, 142, 203, 398, 651, 792, 1314, 3487, 5978, 6240, 7814, 8054, 8673, 21436, 23947, 52985, 91784, 157537, 164901
Offset: 1

Views

Author

Pierre CAMI, Apr 19 2006

Keywords

Comments

A118255(1314) is prime with 396 digits
A118255(23947) is a probable prime with 7209 digits. - Giovanni Resta, Apr 26 2006

Examples

			A118255(2) = 2 prime, A118255(6) = 149 prime, A118255(8) = 599 prime.
		

Crossrefs

Programs

Extensions

a(15)-a(22) from Giovanni Resta, Apr 26 2006
a(23)-a(26) from Michael S. Branicky, Dec 11 2024

A358638 Number of partitions of n into at most 2 distinct nonprime parts.

Original entry on oeis.org

1, 1, 0, 0, 1, 1, 1, 1, 1, 2, 3, 1, 2, 2, 3, 3, 4, 2, 4, 3, 4, 4, 6, 3, 6, 5, 7, 5, 7, 5, 8, 6, 7, 7, 10, 7, 11, 7, 9, 9, 11, 8, 12, 9, 11, 10, 13, 9, 14, 11, 14, 11, 14, 11, 16, 13, 15, 13, 17, 13, 19, 14, 16, 15, 19, 15, 21, 15, 17, 17, 21, 16, 22, 17, 21, 18, 22, 18, 25, 18, 22
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 24 2022

Keywords

Crossrefs

Programs

  • PARI
    A358638(n) = if(n<2,1,!isprime(n)+sum(k=1,(n-1)\2,!(isprime(k)+isprime(n-k)))); \\ Antti Karttunen, Nov 25 2022

Formula

For n > 0, a(n) = A005171(n) + A302479(n).

A050374 Number of ordered factorizations of n into composite factors.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 1, 1, 0, 3, 1, 1, 1, 1, 0, 1, 0, 3, 1, 1, 1, 4, 0, 1, 1, 3, 0, 1, 0, 1, 1, 1, 0, 5, 1, 1, 1, 1, 0, 3, 1, 3, 1, 1, 0, 5, 0, 1, 1, 5, 1, 1, 0, 1, 1, 1, 0, 7, 0, 1, 1, 1, 1, 1, 0, 5, 2, 1, 0, 5, 1, 1, 1, 3, 0, 5, 1, 1, 1, 1, 1, 10, 0, 1, 1, 4, 0, 1
Offset: 1

Views

Author

Christian G. Bower, Nov 15 1999

Keywords

Comments

a(n) depends only on prime signature of n (cf. A025487). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3,1).
The Dirichlet inverse is given by A005171, all but the first term in A005171 turned negative. - R. J. Mathar, Jul 15 2010

Crossrefs

Programs

  • Maple
    read(transforms):
    [1, seq(-A005171(n), n=2..100)] ;
    a050374 := DIRICHLETi(%) ; # R. J. Mathar, May 26 2017
  • PARI
    A050374(n) = if(1==n,n,sumdiv(n,d,if(dA050374(d),0))); \\ Antti Karttunen, Oct 20 2017

Formula

Dirichlet g.f.: 1/(1-B(s)) where B(s) is D.g.f. of characteristic function of composite numbers.
a(n) = A050375(A101296(n)). - R. J. Mathar, May 26 2017
For n >= 1, a(p^n) = A000045(n-1), for any prime p.
For n >= 0, a(A002110(n)) = A032032(n).
Previous Showing 41-50 of 86 results. Next