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.

A253208 a(n) = 4^n + 3.

Original entry on oeis.org

4, 7, 19, 67, 259, 1027, 4099, 16387, 65539, 262147, 1048579, 4194307, 16777219, 67108867, 268435459, 1073741827, 4294967299, 17179869187, 68719476739, 274877906947, 1099511627779, 4398046511107, 17592186044419, 70368744177667, 281474976710659
Offset: 0

Views

Author

Vincenzo Librandi, Dec 29 2014

Keywords

Comments

Subsequence of A226807.

Crossrefs

Cf. Numbers of the form k^n+k-1: A000057 (k=2), A168607 (k=3), this sequence (k=4), A242329 (k=5), A253209 (k=6), A253210 (k=7), A253211 (k=8), A253212 (k=9), A253213 (k=10).

Programs

  • Magma
    [4^n+3: n in [0..30]];
    
  • Mathematica
    Table[4^n + 3, {n, 0, 30}] (* or *) CoefficientList[Series[(4 - 13 x) / ((1 - x) (1 - 4 x)), {x, 0, 40}], x]
  • PARI
    a(n)=4^n+3 \\ Charles R Greathouse IV, Oct 07 2015

Formula

G.f.: (4 - 13*x)/((1 - x)*(1 - 4*x)).
a(n) = 5*a(n-1) - 4*a(n-2) for n > 1.
From Elmo R. Oliveira, Nov 14 2023: (Start)
a(n) = 4*a(n-1) - 9 with a(0) = 4.
E.g.f.: exp(4*x) + 3*exp(x). (End)

A348487 Positive numbers whose square starts and ends with exactly one 1.

Original entry on oeis.org

1, 11, 39, 41, 101, 111, 119, 121, 129, 131, 139, 141, 319, 321, 329, 331, 349, 351, 359, 361, 369, 371, 379, 381, 389, 391, 399, 401, 409, 411, 419, 421, 429, 431, 439, 441, 1001, 1009, 1011, 1019, 1021, 1029, 1031, 1039, 1041, 1099, 1101, 1109, 1111, 1119, 1121, 1129, 1131, 1139
Offset: 1

Views

Author

Bernard Schott, Oct 21 2021

Keywords

Comments

When a square ends with 1, this square ends with exactly one 1.
Sequences A000533 and A253213 show that there are an infinity of terms. The square of their terms, for n >= 3, starts and ends with exactly one 1. Also, the numbers 119, 1119, 11119, ..., ((10^k + 71) / 9)^2, (k >= 3) are terms. The squares ((10^k + 71) / 9)^2, have the last digit 1 and because 12*10^(2*k - 3) < ((10^k + 71) / 9)^2 <13*10^(2*k - 3), for k >= 3, the squares ((10^k + 71) / 9)^2, k >= 4, start with 12. - Marius A. Burtea, Oct 21 2021

Examples

			39 is a term since 39^2 = 1521.
109 is not a term since 109^2 = 11881.
119 is a term since 119^2 = 14161.
		

Crossrefs

Cf. A045855, A090771, A253213, A273372 (squares ending with 1), A017281, A017377.
Cf. A000533, A253213 for n >= 2 (subsequences).
Subsequence of A305719.

Programs

  • Magma
    [1] cat [n:n in [2..1200]|Intseq(n*n)[1] eq 1 and Intseq(n*n)[#Intseq(n*n)] eq 1 and Intseq(n*n)[-1+#Intseq(n*n)] ne 1]; // Marius A. Burtea, Oct 21 2021
  • Mathematica
    Join[{1}, Select[Range[11, 1200], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 1 && d[[2]] != 1 &]] (* Amiram Eldar, Oct 21 2021 *)
  • PARI
    isok(k) = my(d=digits(sqr(k))); (d[1]==1) && (d[#d]==1) && if (#d>2, (d[2]!=1) && (d[#d-1]!=1), 1); \\ Michel Marcus, Oct 21 2021
    
  • Python
    from itertools import count, takewhile
    def ok(n):
      s = str(n*n); return len(s.rstrip("1")) == len(s.lstrip("1")) == len(s)-1
    def aupto(N):
      r = takewhile(lambda x: x<=N, (10*i+d for i in count(0) for d in [1, 9]))
      return [k for k in r if ok(k)]
    print(aupto(1140)) # Michael S. Branicky, Oct 21 2021
    

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