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.

A061762 a(n) = (sum of digits of n) + (product of digits of n).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 4, 9, 14, 19, 24, 29, 34, 39, 44, 49, 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 6, 13, 20, 27, 34, 41, 48, 55, 62, 69, 7, 15, 23, 31, 39, 47
Offset: 0

Views

Author

Amarnath Murthy, May 20 2001

Keywords

Comments

Fixed points a(m) = m are m = {0, 19, 29, 39, 49, 59, 69, 79, 89, 99}. Is this list complete? - Zak Seidov, Aug 22 2007
The above list of fixed points is complete. If a(m) = m, then m < 10^21 and there are no other fixed points below 10^21. - Chai Wah Wu, Aug 14 2017
All numbers are in this sequence. Proof: One can create a number m whose digital sum is any number p and one can create a number k by concatenating digit "0" to m. Then this number k will be a term. - Metin Sariyar, Oct 29 2019

Examples

			a(14) = 1+4 + 1*4 = 9.
		

References

  • S. Parmeswaran, S+P numbers, Mathematics Informatics Quarterly, Vol. 9, No. 3 (Sep 1999), Bulgaria.

Crossrefs

See A130858 for the smallest inverse.

Programs

  • Magma
    [0] cat [&+Intseq(n)+&*Intseq(n): n in [1..80]];// Vincenzo Librandi, Jan 03 2020
  • Maple
    read("transforms") :
    A061762 := proc(n)
        digsum(n)+A007954(n) ;
    end proc: # R. J. Mathar, Aug 13 2012
  • Mathematica
    Table[Plus @@ IntegerDigits[n] + Times @@ IntegerDigits[n], {n, 0, 75}] (* Jayanta Basu, Apr 05 2013 *)
  • PARI
    a(n) = if (n==0, 0, my(d=digits(n)); vecsum(d) + vecprod(d)); \\ Michel Marcus, Oct 29 2019, Jan 03 2020
    
  • Python
    from operator import mul
    from functools import reduce
    def A061762(n):
        a = [int(d) for d in str(n)]
        return sum(a)+reduce(mul,a) # Chai Wah Wu, Aug 14 2017
    

Formula

a(n) = A007953(n) + A007954(n).

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Matthew Conroy, May 23 2001

A171772 Number of steps needed to reach a prime when the map S(n)+M(n) is applied to n, or -1 if a prime is never reached. Here S(n) and M(N) mean the sum and the product of the digits of n in base 10.

Original entry on oeis.org

1, 0, 0, 3, 0, 2, 0, 2, 2, 2, 0, 1, 0, 3, 1, 1, 0, 1, 0, 1, 1, 3, 0, 4, 1, 2, 1, 3, 0, 1, 0, 1, 2, 1, 1, 2, 0, 2, -1, 4, 0, 4, 0, 5, 1, 2, 0, 6, -1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 0, 3, 0, 2, 2, 2, 1, 7, 0, 3, -1, 1, 0, 1, 0, -1, 1, 3, 3, 1, 0, 3
Offset: 1

Views

Author

R. J. Mathar, Oct 12 2010

Keywords

Comments

a(n)=0 if n is a prime.

Examples

			a(4)=3 because 4->8->16->13 is prime.
a(39)=-1 because 39 -> 39 ->39 ... never reaches a prime.
a(49)=-1 because 49 -> 49 ->49 ... never reaches a prime.
a(69)=-1 because 69 -> 69 ->69 ... never reaches a prime.
a(74)=-1 because 74 -> 39 ->39 ... never reaches a prime.
a(28)=3 because 28 ->26 ->20 ->2.
		

Crossrefs

A variant of A074871.

Programs

  • Maple
    f:= proc(n) local L;
      L:= convert(n,base,10);
      convert(L,`+`)+convert(L,`*`);
    end proc:
    g:= proc(n) option remember; local v,w;
         if n::prime then return 0 fi;
         v:= f(n);
         if v = n then return -1 fi;
         w:= procname(v);
         if w = -1 then -1 else w+1 fi
    end proc:
    map(g, [$1..100]); # Robert Israel, Nov 03 2019
Showing 1-2 of 2 results.