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.

User: Irina Gerasimova

Irina Gerasimova's wiki page.

Irina Gerasimova has authored 55 sequences. Here are the ten most recent ones:

A242667 Number of ways of representing n as the sum of one or more consecutive squarefree numbers.

Original entry on oeis.org

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

Author

Irina Gerasimova, May 20 2014

Keywords

Examples

			a(6)=2 because n=6 itself is already a squarefree number (sum of 1 term), and 6 can in addition be written as A005117(1)+ A005117(2)+A005117(3), a sum of 3 consecutive squarefree numbers.
		

Crossrefs

Cf. A005117.

Programs

  • Maple
    A242667 := proc(n)
        a := 0 ;
        for i from 1 do
            if A005117(i) > n then
                return a;
            end if;
            for k from i do
                su := add(A005117(s),s=i..k) ;
                if su = n then
                    a := a+1 ;
                elif su > n then
                    break;
                fi ;
            end do:
        end do:
    end proc:
    seq(A242667(n),n=1..80) ; # R. J. Mathar, Jun 12 2014
    # Alternative:
    N:= 1000:# to get the first N entries
    A005117:= select(numtheory:-issqrfree,[$1..N]):
    M:= nops(A005117);
    A:= Array(1..N):
    t0:= 0:
    for n from 1 to M-1 do
      t0:= t0 + A005117[n];
      t:= t0;
      for i from 1 while t <= N do
         A[t] := A[t]+1;
         if n+i > M then break fi;
         t:= t + A005117[n+i]-A005117[i];
      od;
    od:
    seq(A[i],i=1..N); # Robert Israel, Jun 25 2014
  • Mathematica
    With[{N = 100}, (* to get the first N entries *)
    A005117 = Select[Range[N], SquareFreeQ];
    M = Length[A005117];
    A = Table[0, {N}];
    t0 = 0;
    For[n = 1, n <= M-1, n++,
       t0 = t0+A005117[[n]];
       t = t0;
       For[i = 1, t <= N, i++,
          A[[t]] = A[[t]]+1;
          If[n+i > M, Break[]];
          t = t + A005117[[n+i]] - A005117[[i]]]
       ]
    ];
    A (* Jean-François Alcover, Feb 07 2023, after Robert Israel *)

A240546 a(n) = prime(n+1)^n mod prime(n).

Original entry on oeis.org

1, 1, 3, 4, 10, 1, 9, 5, 16, 9, 26, 10, 33, 1, 2, 49, 33, 3, 35, 48, 3, 32, 62, 64, 4, 20, 8, 62, 93, 83, 64, 41, 68, 79, 138, 125, 88, 56, 4, 169, 72, 36, 40, 144, 73, 140, 63, 120, 24, 218, 67, 48, 58, 194, 126, 54, 74, 223, 74, 59, 176, 161, 280, 208, 215, 236, 82, 141, 139, 344, 7
Offset: 1

Author

Irina Gerasimova, Apr 07 2014

Keywords

Comments

prime(k+1)^k mod prime(k) = k: 1, 3, 4, 76, 7743, ... .

Examples

			a(5) = prime(5+1)^5 mod prime(5) = 13^5 mod 11 = 10.
		

Crossrefs

Cf. A038702.

Programs

  • Magma
    [(NthPrime(n+1)^n mod NthPrime(n)): n in [1..100]]; // Juri-Stepan Gerasimov, Apr 07 2014
    
  • Maple
    a:= n-> ithprime(n+1) &^n mod ithprime(n):
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 30 2014
  • Mathematica
    Table[Mod[Prime[n + 1]^n, Prime[n]], {n, 80}] (* Alonso del Arte, Apr 11 2014 *)
    Table[PowerMod[Prime[n+1],n,Prime[n]],{n,80}] (* Harvey P. Dale, Jun 11 2019 *)
  • PARI
    a(n)=my(p=prime(n)); lift(Mod(nextprime(p+1),p)^n) \\ Charles R Greathouse IV, Apr 08 2014

A237417 Numbers that are the product of an odiousfree number and an evilfree number.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 15, 17, 18, 20, 21, 23, 24, 27, 29, 30, 33, 34, 35, 36, 39, 40, 42, 43, 45, 46, 48, 51, 53, 54, 55, 57, 58, 60, 63, 65, 66, 68, 70, 71, 72, 78, 80, 83, 84, 85, 86, 89, 90, 92, 93, 95, 96, 99, 101, 102, 105, 106, 108, 110, 111, 113, 114, 116, 117, 119, 120, 123, 126, 129
Offset: 1

Author

Irina Gerasimova, Feb 23 2014, following a suggestion from Juri-Stepan Gerasimov

Keywords

Comments

Odiousfree*evilfree numbers: numbers of the form odiousfree*evilfree.
Subsequence of this sequence (A237417): numbers that are not the products of two odious numbers or the products of two evil numbers: 3, 5, 6, 10, 12, 17, 20, 23, 24, 29, 33, 34, 39, 40, 43, 46, 48, 57, 58, 63, 65, 66, 68, 71, 78, 80, 83, 86, 89, 92, 95, 101, 105, 106, 111, 113, 114, 116, 119,...
Putting the 1 aside in A093688, these could be called odiousfree numbers, and are a subsequence of A001969. A093696 would be the evilfree numbers then, and are a subsequence of A000069.

Crossrefs

Programs

  • Maple
    N:= 200: # to get all terms <= N
    Ofree:= {$2..N}: Efree:= {$1..N/3}:
    for n from 2 to N do
      t:= convert(convert(n,base,2),`+`) mod 2;
      if t = 0 then Efree:= Efree minus {seq(i,i=n..N/3,n)}
      else Ofree:= Ofree minus {seq(i,i=n..N,n)}
      fi
    od:
    sort(convert(select(`<=`,{seq(seq(s*t,s=Ofree),t=Efree)},N),list)); # Robert Israel, May 09 2019
  • Mathematica
    odFreeQ[n_] := AllTrue[Rest @ Divisors[n], EvenQ[DigitCount[#, 2, 1]] &]; evFreeQ[n_] := AllTrue[Divisors[n], OddQ[DigitCount[#, 2, 1]] &]; m = 100; o = Select[Range[2, m], odFreeQ]; e = Select[Range[m], evFreeQ]; Union @ Select[Times @@@ Tuples[{o, e}], # <= m &] (* Amiram Eldar, Oct 16 2020 *)
  • PARI
    isA093696(n)= fordiv(n, d, if(hammingweight(d)%2==0, return(0))); 1;
    isA093688(n)= if (n==1, 0, sumdiv(n, d, hammingweight(d)%2)==1);
    lista(nn) = {vn = vector(2*nn, i, i); vof = select(n->isA093696(n), vn); vef = select(n->isA093688(n), vn); vp = []; for (i = 1, #vof, for (j = 1, #vef, vp = Set(concat(vp, vof[i]*vef[j])););); for (i = 1, #vp, if (vp[i] <= nn, print1(vp[i], ", ")););} \\ Michel Marcus, Mar 05 2014

Formula

a(n) = A093688(k+1)*A093696(m).

Extensions

Definition corrected by Jon E. Schoenfield, Feb 26 2014

A236695 The n-th prime with n 0-bits in its binary expansion.

Original entry on oeis.org

2, 43, 41, 139, 269, 773, 1049, 2309, 4357, 8737, 16673, 34819, 66569, 139393, 279553, 589829, 1051649, 2621569, 4260097, 9437189, 17039489, 33817601, 67649537, 167903233, 269484097, 545260033, 1074267137, 2155872769, 4311760897, 12884901893, 17184063521
Offset: 1

Author

Irina Gerasimova, Jan 30 2014

Keywords

Examples

			Primes p(k) such that
A035103(p(k)) = 0: 3, 7, 31, 127, 8191,...
A035103(p(k)) = 1: 2, 5, 11, 13, 23, 29,...
A035103(p(k)) = 2: 19, 43, 53, 79, 103, 107,...
A035103(p(k)) = 3: 17, 37, 41, 71, 83, 89, 101,...
A035103(p(k)) = 4: 67, 73, 97, 139, 149, 163,...
A035103(p(k)) = 5: 131, 137, 193, 263, 269, 277,...
		

Crossrefs

Cf. A066195 (least prime having n zeros in binary), A236513 (the n-th prime with n 1-bits in its binary expansion).

Programs

  • PARI
    nz(n)=#binary(n)-hammingweight(n)
    a(n)=my(k=n);forprime(p=2,,if(nz(p)==n&&k--==0,return(p))) \\ Charles R Greathouse IV, Feb 04 2014

Extensions

New name from Ralf Stephan and Charles R Greathouse IV, Feb 04 2014
a(14)-a(27) from Charles R Greathouse IV, Feb 04 2014
a(28)-a(31) from Giovanni Resta, Feb 04 2014

A236514 Primes with a binary weight greater than or equal to the binary weight of their squares.

Original entry on oeis.org

2, 3, 7, 23, 31, 47, 79, 127, 157, 191, 223, 317, 367, 379, 383, 479, 727, 751, 887, 1087, 1151, 1277, 1279, 1451, 1471, 1531, 1663, 1783, 1789, 1951, 2297, 2557, 2927, 3067, 3259, 3319, 3581, 3583, 3967, 4253, 4349, 5119, 5231, 5503, 5807, 5821, 6079, 6143, 6271, 6653, 6871, 6911, 7039, 7103, 7151
Offset: 1

Author

Irina Gerasimova, Jan 27 2014

Keywords

Comments

Primes p such that A000120(p) = A000120(p^2): 2, 3, 7, 31, 79, 127, 157, 317, 379, 751, 1087, 1151, 1277, 1279,...

Examples

			2 is in this sequence because 2 is 10 in binary representation, and it has as many 1s as its square 4, which is 100 in binary.
		

Crossrefs

Programs

  • Mathematica
    bc[n_] := DigitCount[n, 2][[1]]; Select[Range[7151], PrimeQ[#] && bc[#] >= bc[#^2] &] (* Giovanni Resta, Jan 28 2014 *)
    Select[Prime[Range[1000]], DigitCount[#, 2, 1] >= DigitCount[#^2, 2, 1] &] (* Alonso del Arte, Jan 28 2014 *)
  • PARI
    is(n)=hammingweight(n^2)<=hammingweight(n) && isprime(n) \\ Charles R Greathouse IV, Mar 18 2014

Formula

Primes p such that A000120(p) >= A000120(p^2).

A236513 The n-th prime with n 1-bits in its binary expansion.

Original entry on oeis.org

2, 5, 13, 53, 79, 373, 379, 983, 1783, 6007, 7151, 21503, 31231, 98207, 129919, 259967, 507839, 1564159, 1830911, 4193263, 8355583, 25157567, 33288191, 92274671, 134180863, 394264447, 536838139, 1072693243, 2145382399, 6442188791, 8522825599, 17179836413
Offset: 1

Author

Irina Gerasimova, Jan 27 2014

Keywords

Examples

			Primes p such that
A000120(p) = 1: 2;
A000120(p) = 2: 3, 5, 17, 257,...
A000120(p) = 3: 7, 11, 13, 19, 37, 41,...
A000120(p) = 4: 23, 29, 43, 53, 71, 83, 89,...
A000120(p) = 5: 31, 47, 59, 61, 79, 103, 107, 109,...
A000120(p) = 6: 311, 317, 347, 349, 359, 373,...
		

Crossrefs

Cf. A061712 (least prime having n ones in binary).

Programs

  • Mathematica
    nn = 20; t = Table[-n + 1, {n, nn}]; p = 1; While[Min[t] <= 0, p = NextPrime[p]; b = Total[IntegerDigits[p, 2]]; If[b <= nn, If[t[[b]] < 0, t[[b]]++, If[t[[b]] == 0, t[[b]] = p]]]]; t (* T. D. Noe, Jan 27 2014 *)
  • PARI
    lista(nn) = {prm = primes(5000000); for (n = 1, nn, ltp = select(p->hammingweight(p)== n, prm); print1(ltp[n], ", "););} \\ Michel Marcus, Jan 27 2014
    
  • Python
    from itertools import combinations
    from sympy import isprime
    def A236513(n):
        l, k, c = n-1, 2**n, 0
        while True:
            for d in combinations(range(l-1,-1,-1),l-n+1):
                m = k-1 - sum(2**(e) for e in d)
                if isprime(m):
                    c += 1
                    if c == n:
                        return m
            l += 1
            k *= 2 # Chai Wah Wu, Sep 02 2021

Extensions

a(24)-a(32) from Giovanni Resta, Feb 04 2014

A234431 Numbers that are the sum of 2 successive evil numbers (A001969).

Original entry on oeis.org

3, 8, 11, 15, 19, 22, 27, 32, 35, 38, 43, 47, 51, 56, 59, 63, 67, 70, 75, 79, 83, 88, 91, 94, 99, 104, 107, 111, 115, 118, 123, 128, 131, 134, 139, 143, 147, 152, 155, 158, 163, 168, 171, 175, 179, 182, 187, 191, 195, 200, 203, 207, 211, 214, 219, 224, 227, 230, 235, 239, 243, 248, 251
Offset: 1

Author

Irina Gerasimova, Dec 26 2013

Keywords

Comments

First differences are in {3, 4, 5}; 4*n - 2 <= a(n) <= 4*n. - Charles R Greathouse IV, Dec 26 2013

Crossrefs

Cf. A001969, A003159 (indices of odd numbers in A234431), A131323 (odd numbers in A234431).

Programs

  • Mathematica
    Total/@Partition[Select[Range[0,200],EvenQ[DigitCount[#,2,1]]&],2,1] (* Harvey P. Dale, Nov 02 2015 *)
  • PARI
    a(n)=4*n+hammingweight(n-1)%2+hammingweight(n)%2-2 \\ Charles R Greathouse IV, Dec 26 2013

Formula

a(n) = A001969(n) + A001969(n + 1).

A234218 Primes whose cubes are odious.

Original entry on oeis.org

2, 13, 23, 29, 43, 59, 61, 67, 71, 73, 79, 89, 97, 101, 103, 109, 113, 131, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 229, 241, 251, 293, 311, 313, 337, 353, 367, 383, 389, 397, 409, 419, 431, 439, 443, 461, 467, 479, 499, 509, 521, 541, 563, 577, 601
Offset: 1

Author

Irina Gerasimova, Dec 21 2013

Keywords

Comments

Primes p with odious p^3.
Note: "odious" means having an odd number of 1-bits in number's binary representation. So, put in another way, primes p such that A010060(A000578(p)) = 1. - Antti Karttunen, Dec 22 2013
Subsequence of the numbers 1, 2, 4, 8, 13, 16, 23, 25, 26, 29, 32, 35, 43, 45, 46, ... which have odious cubes.

Examples

			Prime 2 is in this sequence because 2^3 = 8 and 8 is odious number. Prime 13 is in this sequence because 13*3 = 2197 and 2197 is odious number.
		

Programs

  • Mathematica
    Select[Prime[Range[1000]], OddQ[DigitCount[#^3, 2, 1]] &] (* Indranil Ghosh, Apr 02 2017 *)
  • PARI
    is(n)=isprime(n) && hammingweight(n^3)%2 \\ Charles R Greathouse IV, Mar 17 2014

Extensions

Missing terms added by Antti Karttunen, Dec 22 2013

A233866 Ramanujan primes A104272 that are primes p(k) such that (k+1)*p(k)>k*p(k+1).

Original entry on oeis.org

2, 11, 17, 29, 41, 59, 71, 101, 107, 127, 149, 179, 227, 229, 281, 307, 311, 347, 349, 419, 431, 439, 461, 487, 569, 599, 641, 643, 659, 739, 769, 809, 821, 823, 853, 857, 937, 967, 983, 1009, 1019, 1031, 1049, 1061, 1087, 1091, 1151, 1187, 1217, 1229
Offset: 1

Author

Irina Gerasimova, Dec 17 2013

Keywords

Comments

Non-Ramanujan primes (A174635) that are primes p(k) such that (k+1)*p(k)>k*p(k+1): 137, 163, 191, 197, 223, 277, 379, 397, 457, 499, 521, 613, 617, 673, 757, 859, 877, 907, 1093, 1181, 1213, 1223, 1231,...
Primes p(k) such that (k+1)*p(k)> k*p(k+1): 2, 11, 17, 29, 41, 59, 71,...
primes p(k) such that (k+1)*p(k) - k*p(k+1)=1: 2, 11,...
Primes p(m) such that (m+1)*p(m) < m*p(m+1): 3, 5, 7, 13, 19, 23, 31,...

Examples

			Ramanujan prime 2 is in this sequence because 2 = p(1) such that (1 + 1)*p(1) = 2*2 = 4 > 1*p(1 + 1) = 3;
Ramanujan prime 11 is in this sequence because 11 = p(5) such that (5 + 1)*p(5) = 6*11 = 66 > 5*p(5 + 1) = 65.
		

A233409 Squares with squarefree neighbors.

Original entry on oeis.org

4, 16, 36, 144, 196, 256, 400, 484, 900, 1156, 1296, 1600, 1764, 2704, 2916, 3136, 3364, 3600, 4356, 5184, 6084, 7056, 7396, 7744, 8100, 8464, 8836, 9216, 10404, 10816, 11236, 11664, 12100, 12544, 12996, 16384, 16900, 19044, 19600, 20164, 20736, 22500
Offset: 1

Author

Irina Gerasimova, Dec 09 2013

Keywords

Comments

All terms are multiples of 4. Whether n is congruent to 1 or 3 mod 4, n^2 is congruent to 1 mod 3 and therefore mu(n^2 - 1) = 0. - Alonso del Arte, Dec 12 2013

Examples

			36 is in this sequence because 35 and 37 are both squarefree.
64 is not in this sequence because 63 = 3^2 * 7.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[n^2, {n, 150}], SquareFreeQ[# - 1] && SquareFreeQ[# + 1] &] (* Vaclav Kotesovec, Dec 11 2013 *)
    Select[Range[150]^2, Abs[MoebiusMu[# - 1] MoebiusMu[# + 1]] == 1 &] (* Alonso del Arte, Dec 11 2013 *)
    SequencePosition[Table[Which[IntegerQ[Sqrt[n]],1,SquareFreeQ[n],2,True,0],{n,25000}],{2,1,2}][[;;,1]]+1 (* Harvey P. Dale, Jun 27 2023 *)
  • PARI
    forstep(n=2,1e3,[2, 2, 6, 2, 2, 2, 2],if(issquarefree(n-1) && issquarefree(n+1) && issquarefree(n^2+1), print1(n^2", "))) \\ Charles R Greathouse IV, Mar 18 2014