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

A064702 Nonnegative numbers such that additive and multiplicative digital roots coincide.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 123, 132, 137, 139, 168, 173, 179, 186, 188, 193, 197, 213, 231, 233, 267, 276, 299, 312, 317, 319, 321, 323, 332, 346, 364, 371, 389, 391, 398, 436, 463, 618, 627, 634, 643, 672, 681, 713, 719, 726, 731, 762, 791, 816, 818, 839
Offset: 1

Views

Author

Santi Spadaro, Oct 12 2001

Keywords

Comments

If k is in this sequence then all permutations of (the digits of) k are in this sequence.
A010888(a(n)) = A031347(a(n)). - Reinhard Zumkeller, Jul 10 2013

Crossrefs

Programs

  • Haskell
    a064702 n = a064702_list !! (n-1)
    a064702_list = filter (\x -> a010888 x == a031347 x) [1..]
    -- Reinhard Zumkeller, Jul 10 2013
    
  • Maple
    A007954 := proc(n) return mul(d, d=convert(n,base,10)): end: A031347 := proc(n) local m: m:=n: while(length(m)>1)do m:=A007954(m): od: return m: end: A064702 := proc(n) option remember: local k: if(n=1)then return 1:fi: for k from procname(n-1)+1 do if(A031347(k)-1 = (k-1) mod 9)then return k: fi: od: end: seq(A064702(n),n=1..56); # Nathaniel Johnston, May 04 2011
  • Mathematica
    okQ[n_]:=NestWhile[Times@@IntegerDigits[#]&,n,#>9&]== NestWhile[ Total[ IntegerDigits[ #]]&, n,#>9&]; Select[Range[1000],okQ]  (* Harvey P. Dale, Apr 20 2011 *)
  • PARI
    is(n) = my(cn = n); while(cn > 9, d = digits(cn); cn = prod(i = 1, #d, d[i])); cn - 1 == (n-1)%9 \\ David A. Corneth, Aug 23 2018
    
  • Python
    from math import prod
    def A010888(n):
        while n > 9: n = sum(map(int, str(n)))
        return n
    def A031347(n):
        while n > 9: n = prod(map(int, str(n)))
        return n
    def ok(n): return A010888(n) == A031347(n)
    print([k for k in range(840) if ok(k)]) # Michael S. Branicky, Sep 17 2022

Extensions

Definition rephrased by Reinhard Zumkeller, Jul 10 2013
Initial 0 added by Halfdan Skjerning, Aug 21 2018

A239480 Palindromes such that additive and multiplicative persistences coincide.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 99, 101, 111, 121, 131, 141, 151, 161, 171, 202, 212, 222, 262, 282, 303, 313, 393, 404, 424, 454, 474, 525, 545, 565, 585, 595, 636, 656, 676, 757, 838, 858, 959, 1001, 1111, 1221, 1331, 1441, 1991, 2002, 2112, 2552
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 20 2014

Keywords

Comments

Palindromes k for which A031286(k) = A031346(k).

Examples

			99 -> 18 -> 9 has additive persistence 2. 99 -> 81 -> 8 has multiplicative persistence 2. The palindromic number 99 is therefore in the sequence.
		

Crossrefs

Programs

  • PARI
    for(n=0, 2552, s=Vec(Str(n)); if(s==vecextract(s, "-1..1"), v=n; a=0; while(n>9, a++; n=sumdigits(n)); n=v; m=0; while(n>9, m++; d=digits(n); n=prod(k=1, #d, d[k])); n=v; if(a==m, print1(n, ", "))));
    
  • Python
    from math import prod
    from itertools import count, islice, product
    def A031286(n):
        ap = 0
        while n > 9: n, ap = sum(map(int, str(n))), ap+1
        return ap
    def A031346(n):
        mp = 0
        while n > 9: n, mp = prod(map(int, str(n))), mp+1
        return mp
    def is_pal(n): return (s:=str(n)) == s[::-1]
    def pals(base=10): # all d-digit palindromes
        digits = "".join(str(i) for i in range(base))
        for d in count(1):
            for p in product(digits, repeat=d//2):
                if d > 1 and p[0] == "0": continue
                left = "".join(p); right = left[::-1]
                for mid in [[""], digits][d%2]: yield int(left + mid + right)
    def ok(n): return is_pal(n) and A031286(n) == A031346(n)
    def agen(): yield from filter(ok, pals())
    print(list(islice(agen(), 20))) # Michael S. Branicky, Jun 22 2023

Formula

A002113 INTERSECT A239427.

A239477 Smallest number with additive and multiplicative persistence equal to n.

Original entry on oeis.org

0, 10, 28, 289, 2488888888888888999999999
Offset: 0

Views

Author

Giovanni Resta, Mar 20 2014

Keywords

Comments

The corresponding smallest primes are 2, 11, 29, 487 and 2488888888888898999989999.

Examples

			a(3) = 289 because 289 is the smallest number with additive persistence 3, 289 -> 19 -> 10 -> 1 and multiplicative persistence 3, 289 -> 144 -> 16  -> 6.
		

Crossrefs

A239486 Smallest palindrome which has additive and multiplicative persistence n.

Original entry on oeis.org

0, 11, 99, 595, 467778888888979888888877764
Offset: 0

Views

Author

Giovanni Resta, Mar 20 2014

Keywords

Comments

The corresponding sequence made of palindromic primes begins with 2, 11, 12421, 757 and 746788887898878898788887647.

Examples

			a(595) since 595 is the smallest palindrome with additive persistence 3 (595 -> 19 -> 10 -> 1) and multiplicative persistence 3 (595 -> 225 -> 20 -> 0).
		

Crossrefs

A357131 Numbers m such that A010888(m) = A031347(m) = A031286(m) = A031346(m); only the least of the anagrams are considered.

Original entry on oeis.org

0, 137, 11126, 111134, 111278, 1111223, 11111447, 111112247, 1111122227, 111111111137, 11111111111126, 111111111111134, 1111111111111223, 111111111111111111111111111111111111111111111111111111111111111111111111111111111111278
Offset: 1

Views

Author

Mohammed Yaseen, Sep 14 2022

Keywords

Comments

The infinite sequence {(R_1)37, (R_91)37, (R_991)37, (R_9991)37, (R_99991)37, ...} is a subsequence, where R_k is the repunit of length k. Hence this sequence is infinite.
a(14) <= (R_84)278.
Some additional terms < 10^100: (R_84)278, (R_86)447, (R_86)2247, (R_86)22227, (R_91)37, (R_93)26, (R_94)34, (R_93)278, (R_94)223, (R_95)447, (R_95)2247, (R_95)22227.
If a term k > 0 then k cannot contain a digit 0 as if it does A031347(k) = 0 while A031346(k) = 1, contradicting equality. - David A. Corneth, Sep 15 2022
a(14) > 10^50. - Michael S. Branicky, Sep 16 2022
From Michael S. Branicky, Sep 17 2022: (Start)
(R_{10^k})37 and (R_{2*10^k - 10})37 also form infinite subsequences for k >= 0.
Indeed, terms of the form (R_k)e form infinite subsequences for each e in 26, 34, 37, 223, 278, 447, 2247, 22227 for k such that A007953(k + A007953(e)) = 2.
a(2)-a(14) and all terms of the forms above have 2 = A010888(m) = A031347(m) = A031286(m) = A031346(m).
(R_{t})277 where t+2+7+7 = 4 followed by 55555 9's is a term with 4 = A010888(m) = A031347(m) = A031286(m) = A031346(m).
Likewise, there exists a term of the form (R_{t})5579 with 5 = A010888(m) = A031347(m) = A031286(m) = A031346(m), where t+26 is part of the additive persistence chain ending ..., 5999999, 59, 14, 5. Likewise for 888899 and 6, and so on.
However, there are no terms with A010888(m) = A031347(m) = A031286(m) = A031346(m) = 1 or 3. (End)

Examples

			137 is in the sequence as A010888(137) = 137 mod 9 = 2, A031347(137) = 2 via 1*3*7 = 21 -> 2*1 = 2 < 10, A031286(137) = 2 via 1+3+7 = 11 -> 1+1 = 2 so two steps, A031346(137) = 2 via 1*3*7 = 21 -> 2*1 = 2 so two steps. As all these outcomes are 2, 137 is a term. - _David A. Corneth_, Sep 15 2022
		

Crossrefs

Subsequence of A179239.

Extensions

a(8)-a(13) from Pontus von Brömssen, Sep 14 2022
a(14) confirmed by Michael S. Branicky, Sep 17 2022
Showing 1-5 of 5 results.