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 51-60 of 83 results. Next

A367793 Primes p such that the sum of p and its reversal is a semiprime.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 131, 151, 181, 191, 211, 223, 227, 233, 251, 293, 313, 353, 373, 383, 401, 409, 419, 421, 431, 433, 449, 457, 487, 491, 571, 599, 601, 607, 617, 619, 631, 643, 647, 727, 757, 787, 797, 809, 821, 827, 829, 853, 859, 877, 883, 919, 929, 2011
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Nov 30 2023

Keywords

Comments

Terms > 11 with an even number of digits have an even first digit.

Examples

			a(6) = 23 is a term because 23 is a prime and 23 + 32 = 55 = 5 * 11 is a semiprime.
		

Crossrefs

Programs

  • Maple
    digrev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    select(p -> isprime(p) and numtheory:-bigomega(p+digrev(p))=2, [2,seq(i,i=3..10000,2)]);
  • Mathematica
    Select[Prime[Range[10^3]], 2 == PrimeOmega[# + FromDigits[Reverse[IntegerDigits[#]]]] &]

A367798 Primes p such that p^2 is the sum of a prime and its reverse.

Original entry on oeis.org

2, 11, 307, 35419, 347651, 3091643, 3417569, 30001253, 34158919, 35515619, 305524927, 312123463, 313513517, 327371987, 337660679, 348898811, 352023571, 3013005397, 3051026827, 3147298717, 3149171717, 3171167353, 3175236553, 3226951193, 3248169343, 3306563683, 3350101739, 3366748421, 3403341569
Offset: 1

Views

Author

Robert Israel, Nov 30 2023

Keywords

Comments

Primes p such that p^2 = A056964(q) for some term q of A367796.
Do all terms except for 2 and 11 start with 3?
From Ivan N. Ianakiev, Dec 16 2023: (Start)
To prove that for all n > 2 the first digit of a(n) is 3 is easy if the number of digits of q is odd. Sketch of a proof: Let p^2 = q + rev(q). We observe that:
a) the last digit of q must be 1, 3, 7, or 9;
b) the last digit of rev(q) cannot be zero, since the first digit of q cannot be zero;
c) the last digit of rev(q) cannot be odd, since the last digit of p^2 cannot be even (if it were, that would imply that p is even).
The rest is just a matter of bookkeeping.
To prove that for n > 2 the number of digits of q cannot be even is probably much more difficult. (End)

Examples

			a(1) = 2 is a term because 2^2 = 4 = 2 + 2 with 2 prime.
a(2) = 11 is a term because 11^2 = 121 = 29 + 92 with 11 and 29 prime.
a(3) = 307 is a term because 307^2 = 94249 = 20147 + 74102 with 307 and 20147 prime.
a(4) = 35419 is a term because 35419^2 = 1254505561 = 261104399 + 993401162 with 35419 and 261104399 prime.
a(5) = 347651 is a term because 347651^2 = 120861217801 = 20870609999 + 99990607802 with 347651 and 20870609999 prime.
a(6) = 3091643 is a term because 3091643^2 = 9558256439449 = 2059108419947 + 7499148019502 with 3091643 and 2059108419947 prime.
a(7) = 3417569 is a term because 3417569^2 = 11679777869761 = 2080783998959 + 9598993870802 with 3417569 and 2080783998959 prime.
a(8) = 30001253 is a term because 30001253^2 = 900075181570009 = 200000140570007 + 700075041000002 with 30001253 and 200000140570007 prime.
a(9) = 34158919 is a term because 34158919^2 = 1166831747248561 = 206841324099959 + 959990423148602 with 34158919 and 206841324099959 prime.
a(10) = 35515619 is a term because 35515619^2 = 1261359192953161 = 261359249999999 + 999999942953162 with 35515619 and 261359249999999 prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local y,c,d,dp,i,delta,m;
     y:= convert(n^2,base,10);
     d:= nops(y);
     if d::even then
        if y[-1] <> 1 then return false fi;
        dp:= d-1;
        y:= y[1..-2];
        c[dp]:= 1;
     else
        dp:= d;
        c[dp]:= 0;
     fi;
     c[0]:= 0;
     for i from 1 to floor(dp/2) do
        delta:= y[i] - y[dp+1-i] - c[i-1] - 10*c[dp+1-i];
        if delta = 0 then c[dp-i]:= 0; c[i]:= 0;
        elif delta = -1 then c[dp-i]:= 1; c[i]:= 0;
        elif delta = -10 then c[dp-i]:= 0 ; c[i]:= 1;
        elif delta = -11 then c[dp-i]:= 1; c[i]:= 1;
        else return false
        fi;
        if y[i] + 10*c[i] - c[i-1] < 0  or (i=1 and y[i]+10*c[i]-c[i-1]=1) then return false fi;
      od;
      m:= (dp+1)/2;
      delta:= y[m] + 10*c[m] - c[m-1];
      if not member(delta, [seq(i,i=0..18,2)]) then return false fi;
      [seq(y[i]+ 10*c[i]-c[i-1],i=1..m)]
    end proc:
    g:= proc(L) local T,d,t,p, x, i; uses combinat;
      d:= nops(L);
      T:= cartprod([select(t -> t[1]::odd, [seq([L[1]-x,x],x=max(1,L[1]-9)..min(L[1],9))]),
        seq([seq([L[i]-x,x],x=max(0,L[i]-9)..min(9, L[i]))],i=2..d-1)]);
      while not T[finished] do
        t:= T[nextvalue]();
        p:= add(t[i][1]*10^(i-1),i=1..d-1) + L[-1]/2 * 10^(d-1) +
          add(t[i][2]*10^(2*d-i-1),i=1..d-1);
        if isprime(p) then return p fi;
      od;
    -1
    end proc:
    p:= 11: R:= 2, 11:
    while p < 10^8 do
      p:= nextprime(p);
    d:= 1+ilog10(p^2);
      if d::even and p^2 >= 2*10^(d-1) then p:= nextprime(floor(10^(d/2)));  fi;
      v:= f(p);
      if v = false then next fi;
      q:= g(v);
      if q = -1 then next fi;
      R:= R, p;
    od:
    R;

A367871 a(n) is the least prime q such that A367798(n)^2 is the sum of q and its reversal.

Original entry on oeis.org

2, 29, 20147, 261104399, 20870609999, 2059108419947, 2080783998959, 200000140570007, 206841324099959, 261359249999999, 20401390509044927, 20421109564999967, 20000105691609287, 27180442947919997, 20105039549690939, 22040085159209699, 24000605788991999, 2008220921060899607, 2008804724799599927
Offset: 1

Views

Author

Robert Israel, Dec 03 2023

Keywords

Comments

a(n) is the first term q of A367796 such that A056964(q) = A367798(n)^2.

Examples

			a(4) = 261104399 because A367798(3) = 35419 and 35419^2 = 1254505561 = 261104399 + 993401162 and 261104399 is the first prime that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local y, c, d, dp, i, delta, m;
     y:= convert(n^2, base, 10);
     d:= nops(y);
     if d::even then
        if y[-1] <> 1 then return false fi;
        dp:= d-1;
        y:= y[1..-2];
        c[dp]:= 1;
     else
        dp:= d;
        c[dp]:= 0;
     fi;
     c[0]:= 0;
     for i from 1 to floor(dp/2) do
        delta:= y[i] - y[dp+1-i] - c[i-1] - 10*c[dp+1-i];
        if delta = 0 then c[dp-i]:= 0; c[i]:= 0;
        elif delta = -1 then c[dp-i]:= 1; c[i]:= 0;
        elif delta = -10 then c[dp-i]:= 0 ; c[i]:= 1;
        elif delta = -11 then c[dp-i]:= 1; c[i]:= 1;
        else return false
        fi;
        if y[i] + 10*c[i] - c[i-1] < 0  or (i=1 and y[i]+10*c[i]-c[i-1]=1) then return false fi;
      od;
      m:= (dp+1)/2;
      delta:= y[m] + 10*c[m] - c[m-1];
      if not member(delta, [seq(i, i=0..18, 2)]) then return false fi;
      [seq(y[i]+ 10*c[i]-c[i-1], i=1..m)]
    end proc:
    g:= proc(L) local T, d, t, p, x, i; uses combinat;
      d:= nops(L);
      T:= cartprod([select(t -> t[1]::odd, [seq([L[1]-x, x], x=max(1, L[1]-9)..min(L[1], 9))]),
        seq([seq([L[i]-x, x], x=max(0, L[i]-9)..min(9, L[i]))], i=2..d-1)]);
      while not T[finished] do
        t:= T[nextvalue]();
        p:= add(t[i][1]*10^(i-1), i=1..d-1) + L[-1]/2 * 10^(d-1) +
          add(t[i][2]*10^(2*d-i-1), i=1..d-1);
        if isprime(p) then return p fi;
      od;
    -1
    end proc:
    p:= 11: Q:=29:
    while p < 10^8 do
      p:= nextprime(p);
      d:= 1+ilog10(p^2);
      if d::even and p^2 >= 2*10^(d-1) then p:= nextprime(floor(10^(d/2)));  fi;
      v:= f(p);
      if v = false then next fi;
      q:= g(v);
      if q = -1 then next fi;
      Q:= Q, q;
    od:
    Q;

Formula

A056964(a(n)) = A367798(n)^2.

A367900 a(n) is the greatest prime q such that A367798(n)^2 is the sum of q and its reversal.

Original entry on oeis.org

2, 83, 81131, 894500063, 88990607813, 8499228209501, 8597793891803, 800072140300001, 859981720058603, 899969843983163, 82943190509220401, 86999838571212401, 88290616680100001, 89991996902408171, 83909667566050103, 89690298128004023, 89919974791600043, 8069990701280128001, 8299959944574088001
Offset: 1

Views

Author

Robert Israel, Dec 04 2023

Keywords

Comments

a(n) is the last term q of A367796 such that A056964(q) = A367798(n)^2.

Examples

			a(4) = 894500063 because A367798(3) = 35419 and 35419^2 = 1254505561 = 894500063 + 360005498 and 894500063 is the greatest prime that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local y, c, d, dp, i, delta, m;
     y:= convert(n^2, base, 10);
     d:= nops(y);
     if d::even then
        if y[-1] <> 1 then return false fi;
        dp:= d-1;
        y:= y[1..-2];
        c[dp]:= 1;
     else
        dp:= d;
        c[dp]:= 0;
     fi;
     c[0]:= 0;
     for i from 1 to floor(dp/2) do
        delta:= y[i] - y[dp+1-i] - c[i-1] - 10*c[dp+1-i];
        if delta = 0 then c[dp-i]:= 0; c[i]:= 0;
        elif delta = -1 then c[dp-i]:= 1; c[i]:= 0;
        elif delta = -10 then c[dp-i]:= 0 ; c[i]:= 1;
        elif delta = -11 then c[dp-i]:= 1; c[i]:= 1;
        else return false
        fi;
        if y[i] + 10*c[i] - c[i-1] < 0  or (i=1 and y[i]+10*c[i]-c[i-1]=1) then return false fi;
      od;
      m:= (dp+1)/2;
      delta:= y[m] + 10*c[m] - c[m-1];
      if not member(delta, [seq(i, i=0..18, 2)]) then return false fi;
      [seq(y[i]+ 10*c[i]-c[i-1], i=1..m)]
    end proc:
    g:= proc(L) local T, d, t, p,  x, i; uses combinat;
      d:= nops(L);
      T:= cartprod([select(t -> t[1]::odd, [seq([L[1]-x, x], x=min(L[1], 9)..max(1, L[1]-9),-1)]),
        seq([seq([L[i]-x, x], x=min(9, L[i])..max(0, L[i]-9),-1)], i=2..d-1)]);
      while not T[finished] do
        t:= T[nextvalue]();
        p:= add(t[i][1]*10^(i-1), i=1..d-1) + L[-1]/2 * 10^(d-1) +
          add(t[i][2]*10^(2*d-i-1), i=1..d-1);
        if isprime(p) then return p fi;
      od;
    -1
    end proc:
    p:= 2, 11: Q:= 83:
     while p < 10^10 do
      p:= nextprime(p);
      d:= 1+ilog10(p^2);
      if d::even and p^2 >= 2*10^(d-1) then p:= nextprime(floor(10^(d/2)));  fi;
      v:= f(p);
      if v = false then next fi;
      q:= g(v);
      if q = -1 then next fi;
      Q:= Q, q;
    od:
    Q;

Formula

A056964(a(n)) = A367798(n)^2.

A055962 n + reversal of base 12 digits of n (written in base 10).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 13, 26, 39, 52, 65, 78, 91, 104, 117, 130, 143, 156, 26, 39, 52, 65, 78, 91, 104, 117, 130, 143, 156, 169, 39, 52, 65, 78, 91, 104, 117, 130, 143, 156, 169, 182, 52, 65, 78, 91, 104, 117, 130, 143, 156, 169, 182, 195, 65, 78
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

If n has an even number of digits in base 12 then a(n) is a multiple of 13.

Crossrefs

Programs

  • Mathematica
    Table[n + IntegerReverse[n, 12], {n, 0, 100}] (* Paolo Xausa, Aug 08 2024 *)

Formula

a(n) = n + A056961(n).

A072369 Cubes x such that x + reverse of x is a prime.

Original entry on oeis.org

1, 512, 17576, 39304, 42875, 1643032, 1815848, 2352637, 2685619, 3511808, 4826809, 6331625, 7529536, 9528128, 125000000, 153990656, 155720872, 175616000, 181321496, 183250432, 208527857, 265847707, 281011375, 306182024, 308915776, 334255384, 357911000, 403583419
Offset: 1

Views

Author

Shyam Sunder Gupta, Jul 18 2002

Keywords

Examples

			512 is a term because 512 = 9^3 is a cube and 512 + 215 = 727 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], PrimeQ[#^3 + FromDigits @ Reverse @ IntegerDigits[#^3]] &]^3 (* Amiram Eldar, Aug 24 2020 *)
    Select[Range[1000]^3,PrimeQ[#+IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 18 2020 *)

Extensions

More terms from Amiram Eldar, Aug 24 2020

A072382 Primes which can be represented as the sum of a number and its reverse.

Original entry on oeis.org

2, 11, 101, 181, 241, 281, 383, 443, 463, 727, 787, 827, 887, 929, 1009, 1049, 1069, 1151, 1171, 1231, 1291, 1373, 1433, 1453, 1493, 1777, 1877, 10601, 11411, 11801, 12011, 12211, 12421, 12611, 12821, 13421, 13831, 14431, 14831, 15241, 15451
Offset: 1

Views

Author

Shyam Sunder Gupta, Jul 20 2002

Keywords

Comments

Primes in A056964. - Zak Seidov, Dec 04 2013
Some primes have multiple representations, e.g., 383 = 142+241 = 340+43, 44543 = 15292+29251 = 16282+28261 = 17272 +27271 = 18262+26281 = 19252+25291 = 35290+9253 = 36280+8263 = 37270+7273 = 38260+6283 = 39250+5293. - Zak Seidov, Dec 08 2013

Examples

			181 is a term because it is prime and it is the sum of 140 and its reverse 041.
		

Crossrefs

Cf. A056964.

A072387 Triangular number x such that x + reverse of x is a prime.

Original entry on oeis.org

1, 10, 190, 11026, 11476, 12880, 13366, 19306, 21115, 23005, 26335, 28441, 36046, 53956, 54946, 58996, 60031, 65341, 68635, 70876, 72010, 83845, 91378, 1030330, 1047628, 1095940, 1100386, 1154440, 1205128, 1209790, 1223830, 1242676, 1247410, 1266436, 1285606
Offset: 1

Views

Author

Shyam Sunder Gupta, Jul 20 2002

Keywords

Examples

			10 is a term because it is a triangular number and 10 + 01 = 11 is a prime.
		

Crossrefs

Intersection of A000217 and A072366. - Michel Marcus, Nov 29 2014
Cf. A056964.

Programs

  • Mathematica
    tri[n_] := n*(n + 1)/2; tri /@ Select[Range[10^3], PrimeQ[(t = tri[#]) + FromDigits @ Reverse @ IntegerDigits[t]] &] (* Amiram Eldar, Aug 24 2020 *)
    Select[Accumulate[Range[2000]],PrimeQ[#+IntegerReverse[#]]&] (* Harvey P. Dale, Nov 27 2021 *)
  • PARI
    isok(n) = ispolygonal(n, 3) && isprime(n+subst(Polrev(digits(n)), x, 10)); \\ Michel Marcus, Nov 29 2014

Extensions

More terms from Michel Marcus, Nov 29 2014

A110843 a(n) = least non-palindromic k such that k and r(k) have the same n prime divisors, where r(k) is the digit reversal of k.

Original entry on oeis.org

1089, 2178, 21978, 24024, 2426424, 240264024, 23162643504, 2305213214304
Offset: 2

Views

Author

Ryan Propper, Sep 16 2005

Keywords

Comments

Noting that a(6) = a(5)*(10^2+1) and a(7) = a(5)*(10^4+1), we can derive an upper bound for a(n), n>7, of 24024*(10^x+1), where x is the smallest power that gives the number (10^x+1) exactly (n-5) factors-greater-than-13. For n = {8, 9, 10, 11, 12, 13, 14, 15, 16}, this would be x = {10, 14, 16, 36, 30, 55, 45, 77, 70}. I think this upper limit exists for all n, so a(n) always exists. - Hans Havermann, Sep 26 2005
a(9) <= 2305213214304. a(10) <= 230316132350304. [From Donovan Johnson, Apr 09 2010]
The distinct prime factors of a(n) are a subset of the distinct prime factors of A056964(n). - David A. Corneth, Feb 15 2023

Examples

			a(3) = 2178 because 2178 and 8712 both have the same 3 prime divisors and 2178 is the least non-palindromic integer with this property.
		

Crossrefs

Cf. A056964.

Programs

  • Mathematica
    r[n_] := FromDigits[Reverse[IntegerDigits[n]]]; Do[k = 1; While[r[k] == k || Length[Select[Divisors[k], PrimeQ]] != n || Select[Divisors[k], PrimeQ] != Select[Divisors[r[k]], PrimeQ], k++ ]; Print[k], {n, 2, 10}]

Extensions

a(7) from Hans Havermann, Sep 26 2005
a(8) from Donovan Johnson, Apr 09 2010
a(9) from Michael S. Branicky, Feb 15 2023

A185440 Numbers k such that the decimal digits of k + reverse(k) are 0 or 1.

Original entry on oeis.org

0, 5, 10, 19, 28, 37, 46, 55, 64, 73, 82, 91, 100, 109, 159, 208, 209, 258, 307, 308, 357, 406, 407, 456, 505, 506, 555, 604, 605, 654, 703, 704, 753, 802, 803, 852, 901, 902, 951, 1000, 1009, 1010, 1099, 1100, 1189, 1199, 1279, 1289, 1369, 1379
Offset: 0

Views

Author

Michel Lagneau, Feb 03 2011

Keywords

Examples

			258 is in the sequence because 258 + 852 = 1110.
		

Crossrefs

Cf. A056964.

Programs

  • Maple
    with(numtheory): for i from 0 to 2000 do: ii:=0:s1:=0:ll:=length(i):for
      q from 0 to ll do:x:=iquo(i, 10^q):y:=irem(x, 10):s1:=s1+y*10^(ll-1-q): od:n:=i+s1:
      l:=length(n):n0:=n:s:=0:for m from 0 to l-1 do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v
      : if u=0 or u=1 then ii:=ii+1:else fi:od:if ii=l then printf(`%d, `,i):else
      fi:od:
  • Mathematica
    Select[Range[0,2000],Max[IntegerDigits[# +IntegerReverse[#]]]<2&] (* Harvey P. Dale, Sep 30 2023 *)
  • PARI
    isok(k) = if (k, vecmax(digits(k+fromdigits(Vecrev(digits(k))))) == 1, 1); \\ Michel Marcus, May 01 2021
  • Perl
    for (my $k = 1; $k < 10000; $k++) {print "$k, " if (($k + reverse($k)) =~ m/^[01]+$/)} # Charles R Greathouse IV, Feb 04 2011
    
  • Sage
    reverse = lambda n: Integer(str(n)[::-1],base=10)
    is_A185440 = lambda n: set((n+reverse(n)).digits()) <= set([0, 1])
    a = filter(is_A185440, [0..10000]) # D. S. McNeil, Feb 04 2011
    
Previous Showing 51-60 of 83 results. Next