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: Phil Carmody

Phil Carmody's wiki page.

Phil Carmody has authored 24 sequences. Here are the ten most recent ones:

A255724 List of numbers such that no number, nor its reverse, is in the concatenation of all previous terms.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 25, 26, 27, 29, 30, 33, 35, 36, 37, 38, 40, 44, 46, 47, 49, 50, 55, 57, 58, 60, 66, 69, 70, 77, 80, 88, 90, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 112, 114, 115, 116, 117, 118, 122
Offset: 1

Author

Phil Carmody, Mar 19 2015

Keywords

Examples

			After listing 1..11, 12 is not listed as "12" is found in the concatenated earlier terms. After continuing with 13..18, 19 is not listed as "91" is likewise found.
		

Crossrefs

Cf. A048991.

Programs

  • PARI
    lista(nn) = my(d, v=[]); for(n=1, nn, for(i=0, #v-#d=digits(n), (v[i+1..i+#d]==d || v[i+1..i+#d]==Vecrev(d)) && next(2)); print1(n, ", "); v=concat(v, d)) \\ Jinyuan Wang, Aug 23 2021
  • Perl
    $s="";$=0;do{$++;if(index($s,$)<0 && index($s,reverse)<0){print("$ ");$s.=$_}}while(1);
    

Extensions

More terms from Jinyuan Wang, Aug 23 2021

A222714 Smallest i such that prime(n) divides gcd(sigma(i), phi(i)) (cf. A009223).

Original entry on oeis.org

3, 14, 88, 116, 989, 477, 6901, 7067, 6439, 10207, 4976, 10877, 13529, 44461, 79523, 22577, 250277, 62023, 107869, 161027, 75008, 49769, 55277, 183296, 75077, 612463, 381923, 412163, 712423, 153679, 32576, 137549, 450181, 154289, 1776377, 1642577, 491723, 637981, 3903791, 239777, 642251, 1572889, 1608983, 1192739, 2791489, 316409, 888731, 4773091, 4942243, 1256293
Offset: 1

Author

Phil Carmody, Mar 01 2013

Keywords

Examples

			Given A009223 = 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 4, 2, 6, 8, 1, 2, 3, ...
prime(1)=2 first divides A009223(3); prime(2)=3 first divides A009223(14)=6; prime(3)=5 first divides both sigma(88)=180 and phi(88)=40, so A222714(3)=88.
		

Crossrefs

Cf. A009223. Subsequence of A222713.

Programs

  • PARI
    A009223_hunt(x)=local(n=0,g);while(n++,g=A009223(n);if(g%x,,return(n)));
    for(x=1,50,print1(A009223_hunt(prime(x))", "))

A222713 Least number k such that n divides gcd(sigma(k), phi(k)) (A009223).

Original entry on oeis.org

1, 3, 14, 12, 88, 14, 116, 15, 190, 88, 989, 35, 477, 116, 209, 105, 6901, 190, 7067, 88, 196, 989, 6439, 35, 15049, 477, 2754, 172, 10207, 209, 4976, 336, 989, 6901, 1189, 190, 10877, 7067, 477, 248, 13529, 377, 44461, 989, 418, 6439, 79523, 105, 10244, 15049
Offset: 1

Author

Phil Carmody, Mar 01 2013

Keywords

Comments

For each n there are infinitely many numbers k for which n divides sigma(k) and phi(k). - Marius A. Burtea, Mar 28 2019

Examples

			Given A009223 = 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 4, 2, 6, 8, 1, 2, 3, ...
1 first divides A009223(1); 2 first divides A009223(3); 3 first divides A009223(14)=6.
		

Crossrefs

Programs

  • Magma
    [Min([n: n in [1..300000] | IsIntegral(SumOfDivisors(n)/m) and IsIntegral(EulerPhi(n)/m) ]): m in [1..70]]; // Marius A. Burtea, Mar 28 2019
    
  • Magma
    v:=[];
    for n in [1..60] do
    m:=1;
            while  not EulerPhi(m) mod n  eq 0 or not SumOfDivisors(m) mod n  eq 0 do
               v[n]:=0;
               m:=m+1;
            end while;
         v[n]:=m;
    end for;
    v; // Marius A. Burtea, Mar 30 2019
  • Mathematica
    Array[Block[{i = 1}, While[Mod[GCD[DivisorSigma[1, i], EulerPhi@ i], #] != 0, i++]; i] &, 50] (* Michael De Vlieger, Mar 28 2019 *)
  • PARI
    a(n)={my(k=1); while(gcd(sigma(k), eulerphi(k))%n!=0, k++); k}
    

A222712 Record values of gcd(sigma(n), phi(n)) (A009223).

Original entry on oeis.org

1, 2, 4, 6, 8, 24, 48, 72, 120, 192, 240, 336, 720, 960, 1440, 1872, 2016, 2880, 3360, 4032, 5760, 6720, 6912, 7392, 8640, 10080, 17280, 20160, 34560, 40320, 44352, 60480, 69120, 74880, 95040, 96768, 100800, 120960, 134784, 201600, 241920, 322560, 354816, 411840, 483840
Offset: 1

Author

Phil Carmody, Mar 01 2013

Keywords

Comments

RECORDS transform of A009223.

Crossrefs

Cf. A009223, A222711 (indexes where these records are attained).

Programs

  • PARI
    mg=0;for(x=1,1000000,g=A009223(x);if(g>mg,print1(g", ");mg=g))

A222711 Numbers k such that gcd(sigma(k), phi(k)) (A009223) attains record values.

Original entry on oeis.org

1, 3, 12, 14, 15, 35, 105, 190, 248, 357, 616, 812, 1045, 3080, 3135, 3339, 4064, 5049, 8323, 8636, 10659, 12441, 16065, 19780, 20026, 23374, 24871, 29029, 50065, 58435, 64285, 87685, 124355, 132957, 137885, 140335, 248501, 263055, 317205, 353133, 423657, 596037, 655707, 734517, 894387
Offset: 1

Author

Phil Carmody, Mar 01 2013

Keywords

Comments

RECORDS transform of A009223.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; record = 1; a[n_] := a[n] = For[k = a[n-1] + 1, True, k++, g = GCD[DivisorSigma[1, k], EulerPhi[k]]; If[g > record, record = g; Return[k]]]; Table[a[n], {n, 1, 45}] (* Jean-François Alcover, Oct 07 2013 *)
    DeleteDuplicates[Table[{k,GCD[DivisorSigma[1,k],EulerPhi[k]]},{k,900000}],GreaterEqual[ #1[[2]],#2[[2]]]&][[;;,1]] (* Harvey P. Dale, Jun 22 2024 *)
  • PARI
    mg=0;for(x=1,1000000,g=A009223(x);if(g>mg,print1(x", ");mg=g))

A222007 a(n+1) is the smallest prime factor of any (Product_{k=1..j} a(k)) + (Product_{k=j+1..n} a(k)) for j=0..n.

Original entry on oeis.org

2, 3, 5, 11, 41, 7, 23, 17, 19, 13, 37, 53, 73, 151, 29, 43, 31, 59, 71, 47, 79, 61, 107, 83, 103, 163, 109, 89, 101, 113, 67, 97, 137, 131, 139, 127, 229, 149, 173, 227, 179, 239, 181, 191, 193, 167, 197, 241, 277, 157, 233, 211, 397, 257, 271, 283, 251, 281, 313, 269, 347, 349, 317, 263, 379, 223, 367, 199, 353, 401, 421, 463, 293, 337, 383, 389, 331, 431, 359, 443
Offset: 1

Author

Phil Carmody, Feb 23 2013

Keywords

Examples

			For n=4, a = <2,3,5>, yielding sums <1+2*3*5, 2+3*5, 2*3+5, 2*3*5+1> = <31,17,11,31>, with least prime factor a(4)=11.
		

Crossrefs

A modification of A000945, the Euclid-Mullin sequence, which looks only at factors from the j=n term.

Programs

  • PARI
    prodsum(ls) = local(left=1, right=prod(x=1,#ls,ls[x]), o=vector(#ls)); for(x=1,#ls,left*=ls[x];right/=ls[x];o[x]=left+right);o
    newlpf(v) = local(l=0, fs); for(x=1,#v,fs=factor(v[x],if(l>500000,0,l));if(!l||fs[1,1]
    				

A219178 a(n) = first unlucky number removed at the n-th stage of Lucky sieve.

Original entry on oeis.org

2, 5, 19, 27, 45, 55, 85, 109, 139, 157, 175, 213, 255, 265, 337, 363, 387, 411, 423, 457, 513, 547, 597, 637, 675, 715, 789, 807, 843, 871, 907, 987, 1033, 1083, 1113, 1125, 1267, 1297, 1315, 1371, 1407, 1465, 1515, 1555, 1609, 1651, 1671, 1707, 1851, 1873, 1927, 1969
Offset: 1

Author

Phil Carmody, Nov 15 2012

Keywords

Comments

First numbers removed by each lucky number in the lucky number sieve. - This is the original definition of the sequence, still valid from a(2) onward.
a(1) = 2, because at the first stage of Lucky sieve, all even numbers are removed, of which 2 is the first one. - Antti Karttunen, Feb 26 2015

Examples

			1 and 2 are a special case in the lucky number sieve, (1 is the lucky number, but every 2nd element is removed) so are ignored [in the original version of the sequence, which started from a(2). Now we have a(1) = 2. - _Antti Karttunen_, Feb 26 2015]. The 2nd lucky number, 3, removes { 5, 11, ... } from the list, so a(2) = 5. The 3rd lucky number, 7, removes { 19, 39, ... } from the list, so a(3)=19.
		

Crossrefs

Column 1 of A255543, Column 2 of A255545 (And apart from the first term, also column 2 of A255551).

Programs

  • Mathematica
    rows = 52; cols = 1; L = 2 Range[0, 10^4] + 1; A = Join[{2 Range[cols]}, Reap[For[n = 2, n <= rows, r = L[[n++]]; L0 = L; L = ReplacePart[L, Table[r i -> Nothing, {i, 1, Length[L]/r}]]; Sow[Complement[L0, L][[1 ;; cols]]]]][[2, 1]]]; Table[A[[n, 1]], {n, 1, rows}] (* Jean-François Alcover, Mar 15 2016 *)
  • Scheme
    (define (A219178 n) (A255543bi n 1)) ;; Code for A255543bi given in A255543.

Formula

From Antti Karttunen, Feb 26 2015: (Start)
a(n) = A255543(n,1).
Other identities.
For all n >= 2, a(n) = A255553(A001248(n)).
(End)

Extensions

Term a(1) = 2 prepended, without changing the rest of sequence. Name changed, with the original, more restrictive definition moved to the Comments section. - Antti Karttunen, Feb 26 2015

A179113 Odd primes which can never divide 2^a+2^b+1.

Original entry on oeis.org

31, 89, 127, 223, 233, 431, 601, 881, 911, 1103, 1801, 2089, 2351, 3191, 3391, 4513, 5209, 6361, 8191, 9623, 9719, 11447, 11471, 13367, 14951, 15193, 15809, 18041, 18121, 18199, 18287, 20231, 23279, 23671, 39551, 43441, 50023, 53993, 54217, 55441, 55871, 59233
Offset: 1

Author

Phil Carmody, Jan 04 2011

Keywords

Comments

Contains the Mersenne primes M_p for p>3 as a subsequence, as 2^a+2^b cannot exceed 2^(p-1)+2^(p-2) which is less than 2^p-2 is p>3.
Mariusz Skałba conjectures that this sequence has density zero among all primes but contains infinitely many primes based on the following observations. For any prime p in this sequence, the multiplicative order of 2 modulo p is Tomohiro Yamada, Aug 08 2019

Examples

			31 is on the list as you can't sum any two of {1, 2, 4, 8, 16} to make 30 (mod 31).
		

Programs

  • Maple
    N:= 10000; # to test the first N primes for membership
    A179113:= proc(p)
              local x, R;
    x:= 1; R:= {};
    do
      R:= R union {p-1-x};
      if member(x,R) then return(false) end if;
      x:= 2*x mod p;
      if x = 1 then return(true) end if;
    end do;
    end proc;
    select(A179113,[seq(ithprime(i),i=2..N)]);
    # Robert Israel, May 19 2013
  • Mathematica
    n = 10000; (* to test the first n primes for membership *) A179113[p_] := Module[{x = 1, r = {}}, While[True, r = r ~Union~ {p-1-x}; If[MemberQ[r, x], Return[False]]; x = Mod[2*x, p]; If[x == 1, Return[True]]]];Reap[Do[If[A179113[p], Print[p]; Sow[p]], {p, Prime /@ Range[2, n]}]][[2, 1]] (* Jean-François Alcover, Dec 02 2013, translated from Robert Israel's Maple program *)
  • PARI
    forprime(p=3,1000,pol=x+O(x^p);t=2;while(t-1,pol+=x^t;t=t*2%p);pol2=pol*pol;if(!polcoeff(pol2,p-1),print1(p", ")))

Extensions

More terms from Robert Israel, May 19 2013

A171245 Reciprocals of the deviation of continued fraction convergents from Pi.

Original entry on oeis.org

7, -790, 12016, -3748629, 1730431227, -3015428685, 8172837003, -34313104062, 114738541304, -620832653094, 2474837590227, -45157370341559, 1726856191927439, -6094457427533473, 12791098836150787, -51642743340781227, 325724575136738920, -1813676066719263909
Offset: 1

Author

Phil Carmody, Dec 06 2009

Keywords

Comments

Clearly the terms alternate in sign, but the initial choice of sign was arbitrary.

Examples

			The first convergent to Pi, 3, is just over 1/7 too low, so 7 is the first term.
The second convergent, 22/7, is 0.001264+ too high, which is just over 1/790, so -790 is the second term.
		

Crossrefs

Cf. A001203.

Programs

  • PARI
    for(x=1,10,t=contfracpnqn(contfrac(Pi,x));print(truncate(1/(Pi-t[1,1]/t[2,1]))))

Extensions

More terms from Jinyuan Wang, Aug 23 2021

A174106 Smallest primes such that when primes up to and including the n-th term in this sequence are summed, the result will be divisible by 10^n.

Original entry on oeis.org

5, 23, 35677, 106853, 632501, 31190879, 58369153, 707712517, 26219976521, 87424229843, 1642257355619, 2962734127453
Offset: 1

Author

Phil Carmody, Mar 07 2010

Keywords

Comments

In the long term, the prime sums' residues modulo 10^n are uniformly distributed, so one would expect the n-th term to be about the same size as the n-th prime.

Examples

			2+3+5 = 10, so 5 is the 1st term.
2+3+5+7+11+13+17+19+23 = 100, so 23 is the 2nd term.