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

A055483 a(n) is the GCD of n and the reverse of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 3, 1, 1, 3, 1, 1, 9, 1, 2, 3, 22, 1, 6, 1, 2, 9, 2, 1, 3, 1, 1, 33, 1, 1, 9, 1, 1, 3, 4, 1, 6, 1, 44, 9, 2, 1, 12, 1, 5, 3, 1, 1, 9, 55, 1, 3, 1, 1, 6, 1, 2, 9, 2, 1, 66, 1, 2, 3, 7, 1, 9, 1, 1, 3, 1, 77, 3, 1, 8, 9, 2, 1, 12, 1, 2, 3, 88, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 99, 1, 101, 3, 1, 1, 3, 1, 1, 9, 1, 11, 111
Offset: 1

Views

Author

Erich Friedman, Jun 27 2000

Keywords

Comments

a(A226778(n)) = 1; a(A071249(n)) > 1. - Reinhard Zumkeller, Jun 18 2013
a(n) = n iff n >= 1 is a palindrome (n is in A002113). - Felix Fröhlich, Oct 28 2014

Examples

			a(12) = 3 since gcd(12, 21) = 3.
a(13) = 1 since 13 and 31 are coprime.
a(101) = gcd(101, 101) = 101.
		

Crossrefs

Different from A069652, first differs at a(101), since gcd(101, 110) = 1.

Programs

  • Haskell
    a055483 n = gcd n $ a004086 n  -- Reinhard Zumkeller, Jun 18 2013
    
  • Magma
    [Gcd(n, Seqint(Reverse(Intseq(n)))): n in [1..100]]; // Vincenzo Librandi, Oct 29 2014
    
  • Mathematica
    gcn[n_] := GCD[n, IntegerReverse[n]]; Array[gcn, 120] (* Harvey P. Dale, Jan 23 2012 *)
  • PARI
    a004086(n)=eval(concat(Vecrev(Str(n))))
    a(n)=gcd(n, a004086(n)) \\ Felix Fröhlich, Oct 28 2014
    
  • Python
    from math import gcd
    def a(n): return gcd(n, int(str(n)[::-1]))
    print([a(n) for n in range(1, 112)]) # Michael S. Branicky, Aug 31 2021
  • Scala
    def reverseDigits(n: Int): Int = Integer.parseInt(n.toString.reverse)
    def euclGCD(a: Int, b: Int): Int = b match { case 0 => a; case n => Math.abs(euclGCD(b, a % b)) }
    (1 to 120).map(n => euclGCD(n, reverseDigits(n))) // Alonso del Arte, Aug 31 2021
    

Formula

a(n) = gcd(n, A004086(n)). - Felix Fröhlich, Oct 28 2014
3 | a(n) if 3 | n and 9 | a(n) if 9 | n. - Alonso del Arte, Aug 31 2021

Extensions

Edited by Robert G. Wilson v, Apr 10 2002

A071249 Numbers k such that gcd(k, R(k)) > 1, where R(k) (A004086) is the digit reversal of k.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 18, 20, 21, 22, 24, 26, 27, 28, 30, 33, 36, 39, 40, 42, 44, 45, 46, 48, 50, 51, 54, 55, 57, 60, 62, 63, 64, 66, 68, 69, 70, 72, 75, 77, 78, 80, 81, 82, 84, 86, 87, 88, 90, 93, 96, 99, 101, 102, 105, 108, 110, 111, 114, 117, 120, 121
Offset: 1

Views

Author

Amarnath Murthy, May 21 2002

Keywords

Comments

Numbers k such that A055483(k) > 1. - Reinhard Zumkeller, Jun 18 2013

Crossrefs

Cf. A004086, A055483, A226778 (complement).

Programs

  • Haskell
    a071249 n = a071249_list !! (n-1)
    a071249_list = filter ((> 1) . a055483) [1..]
    -- Reinhard Zumkeller, Jun 18 2013
  • Mathematica
    Select[ Range[125], GCD[ #, FromDigits[ Reverse[ IntegerDigits[ # ]]]] > 1 & ]

Extensions

Edited by Robert G. Wilson v, Jun 07 2002
Definition corrected by N. J. A. Sloane, Aug 27 2020 following a suggestion from José Hernández Santiago

A337927 a(n) = n / GCD (n, reverse of n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 4, 13, 14, 5, 16, 17, 2, 19, 10, 7, 1, 23, 4, 25, 13, 3, 14, 29, 10, 31, 32, 1, 34, 35, 4, 37, 38, 13, 10, 41, 7, 43, 1, 5, 23, 47, 4, 49, 10, 17, 52, 53, 6, 1, 56, 19, 58, 59, 10, 61, 31, 7, 32, 65, 1, 67, 34, 23, 10, 71, 8, 73, 74, 25, 76, 1, 26, 79
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 05 2020

Keywords

Comments

a(n)=n for n in A226778. - Robert Israel, Oct 09 2020

Examples

			a(12) = 4 since 12 / gcd(12,21) = 4. a(101) = 101 / gcd(101,101) = 1.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,k;
      L:= convert(n,base,10);
      add(L[-k]*10^(k-1),k=1..nops(L))
    end proc:
    f:= n -> n/igcd(n,rev(n)):
    map(f, [$1..100]); # Robert Israel, Oct 09 2020
  • Mathematica
    Table[n/GCD[n, IntegerReverse[n]], {n, 1, 100}] (* Amiram Eldar, Oct 05 2020 *)
  • PARI
    a(n) = n/gcd(n, fromdigits(Vecrev(digits(n)))); \\ Michel Marcus, Oct 06 2020

Formula

a(n) = n / gcd(n, A004086(n)).
a(n) = n / A055483(n).
a(n) = A000027(n) / A055483(n).
Showing 1-3 of 3 results.