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

A226778 Numbers having no common divisor > 1 with their reversal in decimal representation (see A043537).

Original entry on oeis.org

1, 10, 13, 14, 16, 17, 19, 23, 25, 29, 31, 32, 34, 35, 37, 38, 41, 43, 47, 49, 52, 53, 56, 58, 59, 61, 65, 67, 71, 73, 74, 76, 79, 83, 85, 89, 91, 92, 94, 95, 97, 98, 100, 103, 104, 106, 107, 109, 112, 113, 115, 116, 118, 119, 122, 124, 125, 127, 128, 130
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 18 2013

Keywords

Comments

A055483(a(n)) = 1.

Crossrefs

Cf. A043537, A055483, A071249 (complement).

Programs

  • Haskell
    a226778 n = a226778_list !! (n-1)
    a226778_list = filter ((== 1) . a055483) [1..]
    
  • Mathematica
    Select[Range[130], GCD[#, FromDigits[Reverse[IntegerDigits[#]]]] == 1 &] (* Jayanta Basu, Jul 24 2013 *)
    Select[Range[150],Intersection[Divisors[#],Divisors[IntegerReverse[#]]] == {1}&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 07 2020 *)
  • PARI
    isok(n) = gcd(n, subst(Pol(Vecrev(digits(n))), x, 10)) == 1; \\ Michel Marcus, Jul 02 2015
    
  • PARI
    is(n)=gcd(fromdigits(Vecrev(digits(n))), n)==1 \\ Charles R Greathouse IV, Aug 25 2016

A084434 Numbers whose digit permutations have GCD > 1.

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, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132
Offset: 1

Views

Author

Amarnath Murthy, Jun 02 2003

Keywords

Comments

Numbers k such that there is a number d>1 which divides every number that can be obtained by permuting the digits of k. - N. J. A. Sloane, Aug 27 2020
Theorem. The sequence consists of: (1) A008585 (multiples of 3), (2) A014263 (numbers with all digits even), (3) A014181 (numbers with all digits equal), (4) numbers with all digits 5 or 0, (5) numbers with all digits 7 or 0, (6) numbers with 6k digits, all of which are 1 or 8, and (7) numbers with 6k digits, all of which are 2 or 9. - David Wasserman, May 07 2004

Examples

			72 is in the sequence because 72 and 27 are both divisible by 9.
		

Crossrefs

Subsequence of A084433 which contains for example 592 which is not in here.

Programs

  • Mathematica
    Select[Range[0, 150], GCD @@ FromDigits /@ Permutations[IntegerDigits[#]] > 1 &]  (* Harvey P. Dale, Jan 12 2011 *)

Extensions

More terms from David Wasserman, May 07 2004
Initial zero removed, Harvey P. Dale, Jan 14 2011
Entry revised by N. J. A. Sloane, Aug 27 2020
Showing 1-3 of 3 results.