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-12 of 12 results.

A342681 Primes which, when added to their reversals, produce palindromic primes.

Original entry on oeis.org

241, 443, 613, 641, 811, 20011, 20047, 20051, 20101, 20161, 20201, 20347, 20441, 20477, 21001, 21157, 21211, 21377, 21467, 22027, 22031, 22147, 22171, 22247, 22367, 23017, 23021, 23131, 23357, 23417, 23447, 24007, 24121, 24151, 24407, 25031, 25111, 25117, 25121, 26021, 26107, 26111, 26417, 27011, 27407, 28001
Offset: 1

Views

Author

Tanya Khovanova, Mar 18 2021

Keywords

Comments

It appears that all terms have an odd number of digits. - Robert Israel, Mar 24 2021

Examples

			241 is a prime number. The sum with its reverse is 383 = 241+142, which is a palindromic prime. Thus, 241 is in this sequence.
		

Crossrefs

Cf. A002385. Subsequence of A061783 (Luhn primes: primes p such that p + (p reversed) is also a prime).

Programs

  • Magma
    [p: p in PrimesUpTo(10^6) | IsPrime(t) and Intseq(t) eq Reverse(Intseq(t)) where t is p+Seqint(Reverse(Intseq(p)))]; // Bruno Berselli, Mar 23 2021
  • Maple
    revdigs:= proc(n) local i,L;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    ispali:= proc(n) local L;
      L:= convert(n,base,10);
      andmap(t -> L[t]=L[-t], [$1..nops(L)/2])
    end proc:
    filter:= proc(t) local r; r:= t + revdigs(t);
      ispali(r) and isprime(r);
    end proc:
    select(filter, [seq(ithprime(i),i=1..10000)]); # Robert Israel, Mar 24 2021
  • Mathematica
    Select[Range[30000], PrimeQ[#] && PrimeQ[# + IntegerReverse[#]] && PalindromeQ[# + IntegerReverse[#]] &]
  • PARI
    isok(p) = my(q); isprime(p) && isprime(q=p+fromdigits(Vecrev(digits(p)))) && (q==fromdigits(Vecrev(digits(q)))); \\ Michel Marcus, Mar 18 2021
    
  • Python
    from sympy import isprime, primerange
    def ok(p):
      t = p + int(str(p)[::-1]); strt = str(t)
      return strt == strt[::-1] and isprime(t)
    print([p for p in primerange(1, 28002) if ok(p)]) # Michael S. Branicky, Mar 18 2021
    

A350575 Squarefree numbers k such that k + (k reversed) is also squarefree.

Original entry on oeis.org

1, 3, 5, 7, 10, 11, 14, 15, 19, 21, 23, 30, 33, 34, 37, 41, 42, 43, 46, 51, 55, 58, 59, 61, 67, 69, 70, 73, 77, 78, 82, 85, 86, 87, 89, 91, 94, 95, 101, 102, 105, 106, 109, 111, 115, 118, 119, 130, 131, 134, 138, 139, 141, 142, 146, 149, 151, 155, 158, 159, 161, 166, 170, 174, 178, 181, 182, 185, 190, 191, 194, 195, 199
Offset: 1

Views

Author

Jean-François Alcover, Jan 07 2022

Keywords

Comments

This is to squarefree numbers what A061783 is to primes.

Examples

			14 is a term since it's squarefree and so is 14 + 41 = 55.
		

Crossrefs

Programs

  • Maple
    R:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||n):
    q:= n-> andmap(numtheory[issqrfree], [n, n+R(n)]):
    select(q, [$1..200])[];  # Alois P. Heinz, Jan 07 2022
  • Mathematica
    okQ[n_] := SquareFreeQ[n] && SquareFreeQ[n + IntegerReverse[n]];
    Select[Range[200], okQ]
  • PARI
    isok(m) = issquarefree(m) && issquarefree(m+fromdigits(Vecrev(digits(m)))); \\ Michel Marcus, Jan 07 2022
    
  • Python
    from sympy.ntheory.factor_ import core
    def squarefree(n): return core(n, 2) == n
    def ok(n): return squarefree(n) and squarefree(n + int(str(n)[::-1]))
    print([k for k in range(1, 200) if ok(k)]) # Michael S. Branicky, Jan 07 2022
Previous Showing 11-12 of 12 results.