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.

A349278 a(n) is the product of the sum of the last i digits of n, with i going from 1 to the total number of digits of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 0, 3, 8, 15, 24, 35, 48, 63, 80, 99, 0, 4, 10, 18, 28, 40, 54, 70, 88, 108, 0, 5, 12, 21, 32, 45, 60, 77, 96, 117, 0, 6, 14, 24, 36, 50, 66, 84, 104, 126, 0, 7, 16, 27, 40, 55, 72, 91, 112, 135, 0
Offset: 1

Views

Author

Michel Marcus, Nov 13 2021

Keywords

Comments

This is similar to A349194 but with digits taken in reversed order.
The only primes in the sequence are 2, 3, 5 and 7. - Bernard Schott, Dec 04 2021
The positive terms form a subsequence of A349194. - Bernard Schott, Dec 19 2021

Examples

			For n=256, a(256) = 6*(6+5)*(6+5+2) = 858.
		

Crossrefs

Cf. A349194, A349279 (fixed points).

Programs

  • Mathematica
    a[n_] := Times @@ Accumulate @ Reverse @ IntegerDigits[n]; Array[a, 70] (* Amiram Eldar, Nov 13 2021 *)
  • PARI
    a(n) = my(d=Vecrev(digits(n))); prod(i=1, #d, sum(j=1, i, d[j]));
    
  • Python
    from math import prod
    from itertools import accumulate
    def a(n): return 0 if n%10==0 else prod(accumulate(map(int, str(n)[::-1])))
    print([a(n) for n in range(1, 71)]) # Michael S. Branicky, Nov 13 2021

Formula

From Bernard Schott, Dec 04 2021: (Start)
a(n) = 0 iff n is a multiple of 10 (A008592).
a(n) = 1 iff n = 1.
a(n) = 2 (resp. 3, 4, 5, 7, 9) iff n = 10^k+1 (A000533) (resp. 2*10^k+1 (A199682), 3*10^k+1 (A199683), 4*10^k+1 (A199684), 6*10^k+1 (A199686), 8*10^k+1 (A199689)).
a(R_n) = n! where R_n = A002275(n) is repunit > 0, and n! = A000142(n).
a(n) = A349194(n) if n is palindrome (A002113). (End)

A320771 Primes p for which p-1 and p+1 are Niven numbers.

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 41, 71, 101, 109, 113, 151, 191, 199, 223, 229, 307, 401, 409, 449, 593, 701, 881, 911, 1009, 1013, 1091, 1129, 1231, 1301, 1303, 1451, 1559, 1811, 1999, 2029, 2089, 2213, 2281, 2311, 2351, 2399, 2531, 2609, 2711, 2753, 3037, 3079, 3109, 3221, 3251, 3329
Offset: 1

Views

Author

Marius A. Burtea, Oct 21 2018

Keywords

Comments

All of the prime numbers in sequences A253213, A199684, A199687 are part of the sequence.

Examples

			For p = 11, p-1 = 10 and p + 1 = 12. 10 is divisible by 1 = 1 + 0, 12 is divisible by 3 = 1 + 2. Thus, p = 11 is a term.
For p = 229, p-1 = 228 and p + 1 = 230. 228 is divisible by 12 = 2 + 2 + 8, and 230 is divisible by 5 = 2 + 3 + 0. Thus, p = 229 is a term.
		

Crossrefs

Programs

  • GAP
    Filtered([2..2400],p->IsPrime(p) and (p-1) mod List(List([1..p-1],ListOfDigits),Sum)[p-1]=0 and (p+1) mod List(List([1..p+1],ListOfDigits),Sum)[p+1]=0); # Muniru A Asiru, Oct 29 2018
    
  • Magma
    [p: p in PrimesUpTo(2000) | IsIntegral((p-1)/&+Intseq(p-1)) and IsIntegral((p+1)/&+Intseq(p+1))]; // Marius A. Burtea, Jan 06 2019
  • Mathematica
    nivenQ[n_] := Divisible[n, Total[IntegerDigits[n]]]; Select[Range[10000], PrimeQ[#] && nivenQ[#-1] && nivenQ[#+1] &] (* Amiram Eldar, Oct 31 2018 *)
    nnQ[p_]:=Divisible[p,Total[IntegerDigits[p]]]; Select[Prime[Range[500]],AllTrue[#+{1,-1},nnQ]&] (* Harvey P. Dale, Jul 19 2023 *)
  • PARI
    isniven(n) = frac(n/sumdigits(n)) == 0;
    isok(p) = isprime(p) && isniven(p-1) && isniven(p+1); \\ Michel Marcus, Oct 22 2018
    

A350382 a(n) = 9 + 4 * 10^n.

Original entry on oeis.org

49, 409, 4009, 40009, 400009, 4000009, 40000009, 400000009, 4000000009, 40000000009, 400000000009, 4000000000009, 40000000000009, 400000000000009, 4000000000000009, 40000000000000009, 400000000000000009, 4000000000000000009, 40000000000000000009, 400000000000000000009, 4000000000000000000009
Offset: 1

Views

Author

Bernard Schott, Dec 28 2021

Keywords

Comments

The 4th problem of 16th Tournament of Towns in 1994-1995, Spring tour 1995, 8-9 grades, Training option, asked for a proof that the number 400...009 with at least one zero is not a perfect square (see link).
Indeed, the first few squares whose digits are 0, 4 and 9 are 4900, 9409, 490000, 940900, 994009, ... (comes from A019544).
Generalization: the 4th problem of 16th Tournament of Towns in 1994-1995, Spring tour 1995, 10-11 grades, Training option, asked for a proof that the number d00...009 with at least one zero is not a perfect square, when d is a digit with 1 <= d <= 9 (see link).

Examples

			a(3) = 9 + 4 * 10^3 = 4009 = 19 * 211 is not a square.
		

References

  • Steve Dinh, The Hard Mathematical Olympiad Problems And Their Solutions, AuthorHouse, 2011, Problem 1 (in fact, it is Problem 4) of Tournament of Towns 1995, page 301.

Crossrefs

Programs

  • Maple
    Data := [seq(9 + 4*10^n,  n = 1..20)];
  • Mathematica
    a[n_] := 9 + 4*10^n; Array[a, 20] (* Amiram Eldar, Dec 28 2021 *)

Formula

a(n) = 9 + 4*10^n = 4*A133384(n-1) + 1.
a(n) = 24*A126109(n-1) + 1 = 10*A199684(n-1) - 1. - Hugo Pfoertner, Dec 28 2021
From Stefano Spezia, Dec 28 2021: (Start)
G.f.: x*(49 - 130*x)/((1 - x)*(1 - 10*x)).
a(n) = 11*a(n-1) - 10*a(n-2) for n > 2. (End)
Showing 1-3 of 3 results.