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.

Showing 1-2 of 2 results.

A069706 Primes with property that swapping first and last digits also gives a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 107, 113, 131, 149, 151, 157, 167, 179, 181, 191, 199, 311, 313, 337, 347, 353, 359, 373, 383, 389, 701, 709, 727, 733, 739, 743, 751, 757, 761, 769, 787, 797, 907, 919, 929, 937, 941, 953, 967, 971, 983, 991, 1009, 1013
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Comments

This is not the same as A007500, "palindromic" primes.

Examples

			1049 and 9041 both are primes hence both are members.
		

Crossrefs

Programs

  • Maple
    swapdigs:= proc(n) local d;
      d:= ilog10(n);
      n + ((n mod 10)-floor(n/10^d))*(10^d-1);
    end proc:
    select(isprime and isprime @ swapdigs, [2,seq(2*i+1,i=1..10^4)]); # Robert Israel, Nov 11 2015
  • Mathematica
    Do[t = IntegerDigits[ Prime[n]]; u = t; u[[1]] = t[[ -1]]; u[[ -1]] = t[[1]]; t = FromDigits[u]; If[ PrimeQ[t], Print[ Prime[n]]], {n, 1, 300}]
  • Python
    from sympy import prime, isprime
    A069706_list = [2,3,5,7]
    for i in range(5,10**6):
        p = prime(i)
        s = str(p)
        if isprime(int(s[-1]+s[1:-1]+s[0])):
            A069706_list.append(p) # Chai Wah Wu, Nov 11 2015

Extensions

Edited and extended by Robert G. Wilson v, Apr 12 2002
Edited by N. J. A. Sloane, Jan 20 2009

A069708 Triangular numbers with property that swapping first and last digits also gives a triangular number.

Original entry on oeis.org

1, 3, 6, 10, 55, 66, 120, 153, 171, 190, 300, 351, 595, 630, 666, 820, 1081, 1431, 1711, 1891, 3003, 3403, 5050, 5460, 5565, 5995, 6216, 6786, 8128, 8778, 10011, 10731, 11781, 12561, 13041, 13861, 15051, 15931, 16471, 17020, 17391, 17578, 18721
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Comments

934 of the first 1000 terms begin and end with the same digit. 40 of the first 1000 terms end in zero. Thus, only 26 of the first 1000 terms begin and end with different nonzero digits, with 153 being the smallest and 8026021 being the largest of those terms. - Harvey P. Dale, Jan 09 2021

Examples

			820 and 028 = 28 both are triangular numbers hence both are members.
		

Crossrefs

Programs

  • Mathematica
    Do[t = IntegerDigits[n(n + 1)/2]; u = t; u[[1]] = t[[ -1]]; u[[ -1]] = t[[1]]; t = FromDigits[u]; u = Floor[ Sqrt[2t]]; If[ u(u + 1)/2 == t, Print[n(n + 1)/2]], {n, 1, 300}]
    sfl[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[Flatten[Join[{Last[ idn],Rest[ Most[ idn]],First[ idn]}]]]]; Join[ {1,3,6},Select[ Accumulate[ Range[200]],OddQ[Sqrt[8 sfl[#]+1]]&]//Quiet] (* Harvey P. Dale, Jan 09 2021 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v
Edited by N. J. A. Sloane, Jan 20 2009
Showing 1-2 of 2 results.