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.

Previous Showing 61-70 of 83 results. Next

A249280 Repeatedly apply 'Reverse and add' to n. a(n) gives the number of steps needed to reach a sum containing each digit from 0 to 9 at least once.

Original entry on oeis.org

38, 37, 35, 36, 54, 34, 45, 35, 48, 53, 52, 33, 51, 44, 32, 34, 50, 47, 43, 52, 33, 51, 44, 32, 34, 50, 47, 43, 42, 33, 51, 44, 32, 34, 50, 47, 43, 42, 31, 51, 44, 32, 34, 50, 47, 43, 42, 31, 41, 44, 32, 34, 50, 47, 43, 42, 31, 41, 33, 32, 34, 50, 47, 43, 42
Offset: 1

Views

Author

Felix Fröhlich, Oct 26 2014

Keywords

Comments

Conjecture 1: a(n) exists for all n.
Conjecture 2: There exists an upper bound c such that a(n) < c for all n.
The conjectures seem highly likely, especially since a(n) = 0 for almost all n. A lower bound for c is a(1418993) = 73. (Checked to 10^9.) - Charles R Greathouse IV, Oct 28 2014

Crossrefs

Cf. A056964.

Programs

  • Mathematica
    Table[Length[NestWhileList[#+IntegerReverse[#]&,n,Min[DigitCount[#]] == 0&]]-1,{n,70}] (* Harvey P. Dale, Aug 20 2022 *)
  • PARI
    fromdigits(v,b=10)=subst(Pol(v),'x,b) \\ needed for gp < 2.63 or so
    A056964(n)=fromdigits(Vecrev(digits(n)))+n
    ispan(n)=#Set(digits(n))==10
    a(n)=my(k); while(!ispan(n), n=A056964(n); k++); k \\ Charles R Greathouse IV, Oct 28 2014

A277258 Numbers such that n+R(n) | n*R(n), where R(n) is the digits reverse of n.

Original entry on oeis.org

2, 4, 6, 8, 22, 44, 66, 88, 110, 132, 198, 202, 212, 220, 222, 231, 232, 242, 252, 262, 264, 272, 282, 292, 297, 330, 396, 404, 414, 424, 434, 440, 444, 454, 462, 464, 474, 484, 494, 495, 550, 594, 606, 616, 626, 636, 646, 656, 660, 666, 676, 686, 693, 696, 770
Offset: 1

Views

Author

Paolo P. Lava, Oct 07 2016

Keywords

Comments

This sequence contains all positive terms of A029951. So the sequence is infinite. - Altug Alkan, Oct 07 2016

Examples

			R(132) = 231, (132 * 231) / (132 + 231) = 30492 / 363 = 84.
		

Crossrefs

Programs

  • Maple
    R:=proc(w) local x, y, z; x:=w; y:=0; for z from 1 to ilog10(x)+1 do y:=10*y+(x mod 10); x:=trunc(x/10); od; y; end: P:= proc(q) local n; for n from 1 to q do if type(n*R(n)/(n+R(n)),integer) then print(n); fi; od; end: P(10^4);
  • Mathematica
    Select[Range@ 770, Function[r, Mod[# r, # + r] == 0]@ FromDigits@ Reverse@ IntegerDigits@ # &] (* Michael De Vlieger, Oct 14 2016 *)
  • PARI
    R(n) = eval(concat(Vecrev(Str(n))));
    isok(n) = n*R(n) % (n+R(n)) == 0; \\ Michel Marcus, Oct 15 2016

A298972 Number of positive integers k < n such that n occurs in the Reverse-and-Add trajectory of k.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 2, 2, 0, 1, 0, 4, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Felix Fröhlich, Jan 30 2018

Keywords

Comments

Number of integers k < n such that n occurs in row k of A243238.
For n > 0, a(n) = 0 iff n is a term of A067031.
For n > 0, a(n) > 0 iff n is a term of A067030.

Examples

			For n = 22: There exist 4 positive integers k < 22 such that 22 occurs in the Reverse-and-Add trajectory of k, namely 5, 10, 11 and 20, so a(22) = 4.
		

Crossrefs

Programs

  • Mathematica
    Block[{nn = 85, s}, s = Array[Union@ NestWhileList[# + IntegerReverse@ # &, #, # < nn &, 1, nn] &, nn]; Array[Count[Take[s, # - 1], #, 2] &, nn + 1, 0]] (* Michael De Vlieger, Feb 01 2018 *)
  • PARI
    a(n) = my(i=0); for(k=1, n-1, my(x=k); while(x < n, x=x+eval(concat(Vecrev(Str(x))))); if(x==n, i++)); i

A333523 Number of iterations of Reverse And Add needed to reach a number divisible by n (or 0 if such a number is never reached).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 61, 1, 3, 8, 34, 22, 8, 17, 2, 8, 119, 14, 1, 17, 7, 110, 7, 12, 33, 34, 158, 28, 12, 1, 60, 11, 12, 50, 79, 7, 129, 64, 13, 42, 1, 4, 89, 131, 8, 14, 81, 30, 19, 125, 12, 1, 88, 13, 33, 67, 232, 26, 27, 24, 123, 59, 1, 24, 59, 36, 206, 148, 12, 217, 90, 97
Offset: 1

Views

Author

Daniel Starodubtsev, Mar 26 2020

Keywords

Comments

If n is a palindrome > 0, a(n) = 1. See A002113.
a(n) > 0 for n < 10000.

Examples

			a(12) = 3, because 12 takes 3 iterations (12 -> 33 -> 66 -> 132) to become 132, which is divisible by 12.
		

Crossrefs

Programs

  • PARI
    radd(n) = fromdigits(Vecrev(digits(n)))+n; \\ A056964
    a(n) = {my(i=1, k=n, x); while((x=radd(n)) % k, i++; n=x); i;} \\ Michel Marcus, Apr 11 2020

A338739 Number of true-palindromic compositions of n.

Original entry on oeis.org

1, 2, 2, 4, 4, 8, 8, 16, 16, 31, 32, 62, 63, 124, 126, 248, 252, 496, 504, 991, 1007, 1982, 2013, 3960, 4023, 7914, 8040, 15816, 16068, 31609, 32112, 63171, 64180, 126251, 128266, 252318, 256347, 504268, 512324, 1007801, 1023909, 2014131, 2046338, 4025329, 4089724
Offset: 1

Views

Author

Michel Marcus, Nov 06 2020

Keywords

Comments

A true-palindromic composition or true-palindrome to be a composition whose digit-comma-sequence is the same whether read from left to right or right to left. [Shapcott p. 35]

Examples

			(12, 6, 21) is a true-palindromic composition of 39.
(126, 621) is a true-palindromic composition of 747.
		

Crossrefs

Cf. A016116 (symmetric compositions), A338740.

Programs

  • PARI
    rev(n) = Vecrev(n=digits(n)); \\ A004086
    ispal(n) = Vecrev(n=digits(n))==n; \\ A002113
    radd(n) = fromdigits(Vecrev(digits(n))) + n; \\ A056964
    lista(nn) = my(x='x+O('x^(nn))); Vec(sum(k=0, nn, if (ispal(k), x^k))/(1 - sum(k=1, nn, if (k%10, x^radd(k)))) - 1);

Formula

Shapcott gives a g.f on p. 3, and 1 should be subtracted to get sequence for n>=1.

A338740 Number of hairpin compositions of n.

Original entry on oeis.org

0, 0, 0, 0, 2, 4, 14, 28, 70, 140, 310, 621, 1302, 2607, 5335, 10675, 21593
Offset: 1

Views

Author

Michel Marcus, Nov 06 2020

Keywords

Comments

A hairpin composition with t parts is a composition that is true-palindromic except for a part-sequence in the center of length at least 1 but no more than t-2. [Shapcott p. 46]

Crossrefs

Cf. A016116 (symmetric compositions), A338739.

A344871 a(n) is the least number that can be represented in exactly n ways as the sum of a prime and its digit reversal.

Original entry on oeis.org

1, 4, 44, 88, 1090, 3212, 4334, 2992, 5995, 4994, 7997, 9779, 5104, 11110, 11891, 10109, 11000, 10780, 108880, 110500, 252142, 278872, 296692, 293282, 308902, 287782, 411103, 289982, 466664, 281072, 457754, 398893, 298892, 462154, 517814, 494384, 299992, 707806, 471064, 476674, 487784, 467764
Offset: 0

Views

Author

J. M. Bergot and Robert Israel, May 31 2021

Keywords

Comments

If the reversal of p is another prime, p+reversal(p) and reversal(p)+p are both counted.
a(n) is the first number that occurs exactly n times in A061227.

Examples

			a(4) = 1090 because 1090 = 149+941 = 347+743 = 743+347 = 941+149, and this is the least number with exactly four such representations.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L,t;
    L:= convert(n,base,10);
    add(L[-t]*10^(t-1),t=1..nops(L));
    end proc:
    V:= Vector(10^6):
    p:= 1:
    do
      p:= nextprime(p);
      if p > 9*10^5 then break fi;
      r:= p+revdigs(p);
      if r <= 10^6 then V[r]:= V[r]+1 fi
    od:
    A:= Array(0..64):
    for i from 1 to 10^6 do
      if V[i] <= 64 and A[V[i]] = 0 then A[V[i]]:= i fi
    od:
    convert(A,list);

A345410 a(n) is the least number that is the sum of an emirp and its reversal in exactly n ways.

Original entry on oeis.org

44, 1090, 10450, 5104, 88888, 10780, 289982, 299992, 482174, 478874, 868868, 499994, 1073270, 1087790, 1071070, 1069970, 10904990, 10794980, 1091090, 10892990, 1100000, 29955992, 1101100, 26688662, 31022002, 27599572, 46400354, 44688644, 29821792, 45289244, 30122092, 26988962
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jun 18 2021

Keywords

Comments

Interchanging an emirp and its reversal is not counted as a different way.
a(n) is the least number k such that there are exactly n unordered pairs of distinct primes (p,p') such that p' is the digit reversal of p and p+p' = k.
Are terms not divisible by 3? Amiram Eldar finds proof they are; A056964(n) = n + reverse(n) is divisible by 3 if and only if n is divisible by 3. But emirps are primes (other than 3) so they are not divisible by 3. - David A. Corneth, Jun 19 2021

Examples

			a(3) = 10450 because 10450 = 1229+9221 = 1409+9041 = 3407+7043.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L,i; L:= convert(n,base,10); add(L[-i]*10^(i-1),i=1..nops(L)) end proc:
    isemirp1:= proc(n) local r;
    if not isprime(n) then return false fi;
    r:= revdigs(n);
    r > n and isprime(r)
    end proc:
    E:= select(isemirp1, [seq(seq(seq(i*10^d+j,j=1..10^d-1,2),i=[1,3,7,9]),d=1..5)]):
    V:= sort(map(t -> t+revdigs(t),E)):
    N:= nops(V):
    W:= Vector(16):
    i:= 1:
    while i < N do
    for j from 1 to N-i while V[i+j]=V[i] do od:
    if j <= 16 and W[j] = 0 then W[j]:= V[i] fi;
      i:= i+j;
    od:
    convert(W,list);
  • Python
    from itertools import product
    from collections import Counter
    from sympy import isprime, nextprime
    def epgen(start=1, end=float('inf')): # generates unique emirp/prime pairs
        digits = 2
        while True:
          for first in "1379":
            for last in "1379":
              if last < first: continue
              for mid in product("0123456789", repeat=digits-2):
                strp = first + "".join(mid) + last
                revstrp = strp[::-1]
                if strp >= revstrp: continue
                p = int(strp)
                if p > end: return
                revp = int(strp[::-1])
                if isprime(p) and isprime(revp): yield (p, revp)
          digits += 1
    def aupto(lim):
        alst = []
        c = Counter(sum(ep) for ep in epgen(1, lim) if sum(ep) <= lim)
        r = set(c.values())
        for i in range(1, max(r)+1):
            if i in r: alst.append(min(s for s in c if c[s] == i))
            else: break
        return alst
    print(aupto(11*10**5)) # Michael S. Branicky, Jun 19 2021

Extensions

More terms from David A. Corneth, Jun 18 2021

A350575 Squarefree numbers k such that k + (k reversed) is also squarefree.

Original entry on oeis.org

1, 3, 5, 7, 10, 11, 14, 15, 19, 21, 23, 30, 33, 34, 37, 41, 42, 43, 46, 51, 55, 58, 59, 61, 67, 69, 70, 73, 77, 78, 82, 85, 86, 87, 89, 91, 94, 95, 101, 102, 105, 106, 109, 111, 115, 118, 119, 130, 131, 134, 138, 139, 141, 142, 146, 149, 151, 155, 158, 159, 161, 166, 170, 174, 178, 181, 182, 185, 190, 191, 194, 195, 199
Offset: 1

Views

Author

Jean-François Alcover, Jan 07 2022

Keywords

Comments

This is to squarefree numbers what A061783 is to primes.

Examples

			14 is a term since it's squarefree and so is 14 + 41 = 55.
		

Crossrefs

Programs

  • Maple
    R:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||n):
    q:= n-> andmap(numtheory[issqrfree], [n, n+R(n)]):
    select(q, [$1..200])[];  # Alois P. Heinz, Jan 07 2022
  • Mathematica
    okQ[n_] := SquareFreeQ[n] && SquareFreeQ[n + IntegerReverse[n]];
    Select[Range[200], okQ]
  • PARI
    isok(m) = issquarefree(m) && issquarefree(m+fromdigits(Vecrev(digits(m)))); \\ Michel Marcus, Jan 07 2022
    
  • Python
    from sympy.ntheory.factor_ import core
    def squarefree(n): return core(n, 2) == n
    def ok(n): return squarefree(n) and squarefree(n + int(str(n)[::-1]))
    print([k for k in range(1, 200) if ok(k)]) # Michael S. Branicky, Jan 07 2022

A359011 Numbers k such that k^2 + the reversal of k^2 is a square.

Original entry on oeis.org

0, 231, 9426681, 8803095102, 56017891104, 4811618419542
Offset: 1

Views

Author

Michel Marcus, Dec 11 2022

Keywords

Crossrefs

Extensions

a(1)-a(5) from Douglas McNeil and Zak Seidov, Nov 09 2010
a(6) from Giovanni Resta, Sep 26 2011
Previous Showing 61-70 of 83 results. Next