[Question]
  [
A palindromic number, as a refresher, is any number which reads the same forward as backwards. However, what about palindromes in other bases?
## Input
Any integer `b` where `b > 1`.
## Output
All integer base 10 numbers from 0 to 1000 inclusive that are palindromes in base b. The output can either be a list of integers, or integers separated by a delimiter such as a comma or a newline.
## Test cases
`Input->Output`
`10->{0,1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99,101,111,121,131,141,151,161,171,181,191,202,212,222,232,242,252,262,272,282,292,303,313,323,333,343,353,363,373,383,393,404,414,424,434,444,454,464,474,484,494,505,515,525,535,545,555,565,575,585,595,606,616,626,636,646,656,666,676,686,696,707,717,727,737,747,757,767,777,787,797,808,818,828,838,848,858,868,878,888,898,909,919,929,939,949,959,969,979,989,999}`
`2->{0,1,3,5,7,9,15,17,21,27,31,33,45,51,63,65,73,85,93,99,107,119,127,129,153,165,189,195,219,231,255,257,273,297,313,325,341,365,381,387,403,427,443,455,471,495,511,513,561,585,633,645,693,717,765,771,819,843,891,903,951,975}`
`9->{0,1,2,3,4,5,6,7,8,10,20,30,40,50,60,70,80,82,91,100,109,118,127,136,145,154,164,173,182,191,200,209,218,227,236,246,255,264,273,282,291,300,309,318,328,337,346,355,364,373,382,391,400,410,419,428,437,446,455,464,473,482,492,501,510,519,528,537,546,555,564,574,583,592,601,610,619,628,637,646,656,665,674,683,692,701,710,719,728,730,820,910,1000}`
  
[Answer]
# [Python 3](https://docs.python.org/3/), 78 bytes
Outputs the numbers in decreasing order `1000 -> 0`, and short-circuits with a `ZeroDivisionError`
```
def f(b,n=1000):
 r=0;m=n
 while m:r=r*b+m%b;m//=b
 n==r==print(n);f(b,n-n//n)
```
[Try it online!](https://tio.run/##HcvLDgIhDEDRPV/RjQn4AnXlkP4MCpkm0zIpGDNfj4@bnOVdtz5XuQ3itWqHtjXzdW65a368tFGVhZi6vf9y45kLFJuOgpcQgpsMKIbIKAbeMy0ZeFLUfTrwLkX2HpMBQVTEVUm6FRf/@0m8FzeKvbrxAQ "Python 3 – Try It Online")
The `f(b,n-n//n) -> f(b,n-1)` recurses until `0`, and errors because dividing by zero is undefined.
### [Python 3](https://docs.python.org/3/), 76 bytes
We can shorten the answer by 2 bytes if a floating-point output is allowed.
```
def f(b,n=1e3):
 r=0;m=n
 while m:r=r*b+m%b;m//=b
 n==r==print(n);f(b,n-n/n)
```
[Try it online!](https://tio.run/##HcvLDgIhDEDRPV/RjQn4Qp2VQ/ozKGSaTAspGDNfj4@bnOWtW1@KTIO4Fu3Qtma@zi11TY@XNiqyElO3919uPFOGbONR8JomNxtQvARGMfBeaE3As6Lu44F3MbD3GA0IoiJWJelWXPjfJ/HiRrY3Nz4 "Python 3 – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/) forwards, ~~118~~ ~~117~~ 115 bytes
```
b[11],*p,*x,i,m;f(n){for(i=-1;i++<1e3;){for(p=x=b,m=i;m;*p++=m%n,m/=n);while(p>x)m|=*--p-*x++;m||printf("%d,",i);}}
```
[Try it online!](https://tio.run/##ZcvNCoJAFIbhvVcxGML8lmOrOI03Ui3KnzzgTEMZCeq1m1gtpLN6@XhOpq5ZNo6Xg9Ynyb3krURpoaSOdeXtTtEoDSjEXhdb@EzetOYirUGwwL0QxkZO2o1xDF4V1gX1actsb7hSXvFWCLB97@/ompKGUS5DiQyGYVyhy@pnXpD9o8nxtq7SIJgQsWd0lAVdQKb7/emYmJSEDOa1pDr@5g8cXbIUyR/YLcFuqmHu8Q0 "C (gcc) – Try It Online")
# [C (gcc)](https://gcc.gnu.org/), backwards, ~~115~~ 113 bytes
```
b[11],*p,*x,i,m;f(n){for(i=1001;i--;){for(p=x=b,m=i;m;*p++=m%n,m/=n);while(p>x)m|=*--p-*x++;m||printf("%d,",i);}}
```
[Try it online!](https://tio.run/##ZcvLDoIwEIXhPU/RYEx6VcrOjOVF1IUUkElsbbzEJsKzI1FZEGf15@Qbq07WDkO50/ogeZA8SpQOGurZq7lcKRqdZRpQKfgOwURTSmcQHPAghHFLL93aeAbPFs81DUVkrjNcqaB4FAJc14Ur@ntD02UlU4kM@n5YoLfnR1WT7e1e4WXVFkkyIuKO6ClLXgkZb/rTGTEFSRl81obq7JcT2Pt8LvI/sJmDzVj9p4c3 "C (gcc) – Try it online")
## Explanation
C signature:
```
// Technically implicit int with a void return
void f(int base);
```
Loops through all numbers from 0 to 1000, converts them to base `base` by hand, then checks if it is a palindrome.
The backwards version does the same thing, but backwards.
Prints matching numbers, comma separated, to stdout.
Ungolfed version
```
#include <stdio.h>
// A buffer to hold our converted integer.
// It is large enough for 1000 in binary.
int buffer[11];
// Start and end pointers for buffer
int *start, *end;
// Loop counter
int i;
// Temporary
int tmp;
void f(int base)
{
    // Loop for 0 to 1000
#ifdef BACKWARDS
    // Loop backwards
    for (i = 1001; i-- != 0;) {
#else
    // Loop forwards
    // for (i = 0; i <= 1000; i++)
    for (i = -1; i++ < 1e3; ) {
#endif
        // Convert to base in buffer, tracking the length in end.
        for(start = end = buffer, tmp = i; tmp != 0;) {
            *end++ = tmp % base;
            tmp /= base;
        }
        // Check if it is a palindrome.
        // Loop while our starting pointer is less than our ending pointer.
        // tmp will zero at the start thanks to the loop condition.
        while (end > start)
            // Assembly style comparison using subtraction.
            // If *end == *start, tmp will still be zero.
            // If not, it will be permanently set to non-zero with a binary or.
            tmp |= *--end - *start++;
        // If tmp is still zero (meaning it is a palindrome), print.
        tmp || printf("%d,", i);
    }
}
```
Thanks to Arnauld for the -1 bytes!
Thanks to Toby Speight for the -2 bytes!
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes
```
₄ÝʒIвÂQ
```
[Try it online!](https://tio.run/##yy9OTMpM/f//UVPL4bmnJnle2HS4KfD/f0MDAwMA "05AB1E – Try It Online")
## Explained
```
₄Ý	"Push the range [0, 1000]"\
  ʒ	"and keep the items where:"\
   Iв	"After being converted to base (input)"\
     ÂQ	"have its reverse equal to itself"\
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
ȷŻbŒḂ¥Ƈ
```
[Try it online!](https://tio.run/##ASIA3f9qZWxsef//yLfFu2LFkuG4gsKlxof/w4figqz//zEwLCAy "Jelly – Try It Online")
## How it works
```
ȷŻbŒḂ¥Ƈ - Main link. Takes a base b on the left
ȷ       - 1000
 Ż      - [0, 1, 2, ..., 1000]
     ¥  - Group the previous 2 links into a dyad f(k, b):
  b     -   Convert k to base b
   ŒḂ   -   Is this a palindrome?
      Ƈ - Filter [0, 1, 2, ..., 1000], keeping those k that are true under f(k, b)
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
A³ô fÈìU êê
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QbP0IGbI7FUg6uo&input=Mg)
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 44 bytes
```
Pick[r=0~Range~1000,r-r~IntegerReverse~#,0]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n277PyAzOTu6yNagLigxLz21ztDAwECnSLeozjOvJDU9tSgotSy1qDi1TlnHIFbtf0BRZl6JgkN6tKFBLBeEE62kBGMCxY2wC1vG/v8PAA "Wolfram Language (Mathematica) – Try It Online")
-13 bytes from @att
[Answer]
# JavaScript (ES6), ~~87~~ 86 bytes
Returns a comma-separated string.
```
n=>(g=k=>--k&&g(k)+((h=k=>a=k?[k%n,...h(k/n|0)]:[])(k)+''==a.reverse()?[,k]:''))(1001)
```
[Try it online!](https://tio.run/##ZcqxDsIgEADQ3f@w3MWC1M0m134IYSCVUr0GDJhO/jva0bi@vIfbXJny/fmSMd18nalGGiAQ0yAlN00AxhPAsoMjHg0fY6uUWoDP8a3R9sbifoQgcir7zefiAUfTsu2FQIRO6w7rlGJJq1drCjB/DfHwS5c/uSLWDw "JavaScript (Node.js) – Try It Online")
### How?
```
n => (                        // n = input base
  g = k =>                    // g is a recursive function taking a counter k
    --k &&                    //   decrement k; abort if it's equal to 0
    g(k) + (                  //   otherwise do a recursive call and append the ...
      ( h = k =>              //   ... result of the recursive function h
        a = k ?               //     which builds an array a[]
          [ k % n,            //     consisting of each digit of k in base n,
            ...h(k / n | 0) ] //     dividing k by n and taking the integer part
        :                     //     for the next iteration until k = 0
          []                  //
      )(k) + ''               //   invoke h with k and coerce the result to a string
      == a.reverse() ?        //   if this is palindromic:
        [, k]                 //     append a comma followed by k to the output
      :                       //   else:
        ''                    //     just append an empty string
    )                         //
)(1001)                       // initial call to g with k = 1001
```
[Answer]
# [Scala](http://www.scala-lang.org/), ~~62~~ 87 bytes
* Fixed after Siu Ching Pong -Asuka Kenji- pointed out `BigInt`'s `toString` only works for bases up to 36.
* Saved 1 byte thanks to [@cubic lettuce](https://codegolf.stackexchange.com/users/74778/cubic-lettuce).
```
b=>0 to 1000 filter{x=>val y=Seq.unfold(x){q=>Option.when(q>0)(q%b,q/b)};y==y.reverse}
```
[Try it online!](https://scastie.scala-lang.org/zTFJgi3VQ3e8ZrLa3yrPLQ)
This is pretty straightforward. It makes a range from 0 to 1000, then filters by checking if they equal their reverse in base `b`. To convert to base `b` (as a string), `BigInt`'s `toString` method ~~is~~was used, but now `Seq.unfold` is used to create a `Seq` of digits.
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~12~~ 11 bytes
*Edit: -1 byte thanks to LegionMammal978*
```
foS=↔B⁰ŀdḋ9
```
[Try it online!](https://tio.run/##yygtzv7/Py0/2PZR2xSnR40bjjakPNzRbfn//38jAA "Husk – Try It Online")
The actual 'based palindrome' code is 7 bytes (`foS=↔B⁰`), but specifying 0...1000 costs ~~5~~ 4 (thanks to LegionMammal978) more bytes.  
We could save a byte if it's Ok to output a few more based palindromes with values up to decimal 1024 (`foS=↔B⁰ŀ□32`).
```
f               # output the truthy values of
       ŀdḋ9     # series from zero up to one less than 1001
                # (decimal interpretation of binary digits of '9')
 o              # based on combination of 2 functions:
  S=↔           # 1. is it equal to reverse of itself?
     B⁰         # 2. digits in base given by argument
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 14 bytes
```
ＮθＩΦ⊕φ⁼↨ιθ⮌↨ιθ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98zr6C0xK80Nym1SKNQ05oroCgzr0TDObG4RMMtM6cEKOqZl1yUmpuaV5KaopGmqaPgWliamFOs4ZRYnKqRqaNQCBQKSi1LLQJyEWJgYP3/v@V/3bIcAA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｎθ              Input the base `b`
     φ          Predefined variable 1000
    ⊕           Incremented
   Φ            Filter on implicit range
        ι       Current value
       ↨ θ      Converted to base `b`
      ⁼         Equals
            ι   Current value
           ↨ θ  Converted to base `b`
          ⮌     Reversed
  Ｉ             Cast to string
                Implicitly print
```
[Answer]
# [Haskell](https://www.haskell.org/), 63 bytes
```
f b|let 0%m=m;n%m=div n b%(m*b+mod n b)=[n|n<-[0..1000],n==n%0]
```
[Try it online!](https://tio.run/##XYgxDsIwDAB3XuElUgO0ctkQ@CVVh6RpICJ2I1ox9e2YMsINJ93d3fwYc1aN4Nc8LoCGiS@yOaQXCHhT8d4feArfsNTJKte6w6ZpEbE/CpEY7JVdEiAI0w42yjPJAlWEFu3vOP312ep7iNndZq2HUj4 "Haskell – Try It Online")
Based on a nice idea from [dingledooper's Python answer](https://codegolf.stackexchange.com/a/216981/20260): to check that `n` is a base-`b` palindrome, don't generate the list of base-`b` digits, but reverse `n` as a base-`b` number by running a base-conversion reading digits from the end, and check that the result still equals `n`.
The code `|let 0%m=m;n%m=div n b%(m*b+mod n b)` recursively defines an infix function `%` that reverses base `n` (given `0` as an initial second argument). Defining it inside of a `let` guard lets us access the argument `b` to the main function, whereas a standalone function would need to keep passing it with each recursive call.
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), ~~17~~ 15 bytes
Thanks to [Razetime](https://codegolf.stackexchange.com/users/80214/razetime) for -2 bytes!  
A bug fixed thanks to [Siu Ching Pong](https://codegolf.stackexchange.com/users/74641/siu-ching-pong-asuka-kenji)!
Requires index origin `0`.
```
⍸⎕(⊤≡∘⌽⊤)¨⍳1001
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qKM97f@j3h2P@qZqPOpa8qhz4aOOGY969gLZmodWPOrdbGhgYAhS9R@owtP/UdsEAy4ukJiCAoZ6S0tLLi51BSMrda40LiMurke9a7jUDQ3AXEMDKN8SzLWEyxoYQuUNDAE "APL (Dyalog Extended) – Try It Online")
```
                 ⍝ tradfn taking the base as input
          ⍳1001  ⍝ the indices up to 1000
 ⍵(     )¨       ⍝ apply a function to each index as a right argument and the input base as a left argument:
      ⌽⊤         ⍝  the reverse of the index converted to the input base 
    ≡            ⍝  does it match 
   ⊤             ⍝  the index converted to the input base
⍸                ⍝ all truthy indices
```
[Answer]
# C - [76 bytes](https://tio.run/##TU/basQgEH3PVwxZFtQYkvStiP0XtSY7sDWLMS24m2@3mtCSgWFmzgXOmHYyJiWUQ98PXPEoRqLpc5w9Edi2uePr9fDowkjq6yfUHCktrJLIo@yFEqqTmkYZmW7UVYstZTF8KXSkLMpPhoO5KQ@M5eObVs8Kcv3c8G6BsKbZUTjQUsWmQYIKM5LDI/7JvyyXC@Q48iMnAn3iS/yTeg0LqesTcnwqoGPg7WIDLOimu23XxcK4OhNwdsC6Xb9V2z5TGvr0lt5/AQ "C (gcc) – Try It Online")
```
i=1001,a,z;f(b){for(;i--;i-z||printf("%d ",i))for(a=i,z=0;a;a/=b)z=z*b+a%b;}
```
# Explanation
Sufficiently different from [my earlier answer](/a/216970/39490) to warrant posting separately. This time, we completely reverse the number, then compare to the original. So we don't need to eliminate trailing zeros, or special-case `0`.
```
void fun(int b)
{
    for (int i = 1001; i--;) {
        int z = 0;
        for (int a = i; a != 0; a /= b) {
            z = z*b + a%b;
        }
        if (i==z) {
            printf("%d ",i);
        }
    }
}
```
This method works reliably for `i` up to `INT_MAX/b` and `b` up to `INT_MAX`, or the appropriate equivalents if we change the integer type used. For unsigned types (or with `gcc -fwrapv`), it should work for the full range of `i`.
[Answer]
# C, 100 bytes
```
i=1001,a,z;f(b){for(;--i;)for(a=i,z=0;i%b*a;a/=b)if(a==z||a==(z=z*b+a%b))printf("%d ",i);puts("0");}
```
[Try it online](https://tio.run/##TU9db4QgEHz3V2y8mABi1L41hP4XoOBtcsWLYptw52@noOnHPuzOzuxksqabjEkJ5TgMI1c8Ckc0fbh5IaLrUNCClEQe5SCw0UwJ1UtN0WVWxuczdxJlZLpVjab0vqAPjtTNO9QcqbhvYSX1UFOxp6zAh0JPClDLZDiYq1qAsbx80upRQa6vK94sENa2BwsnW6rYNEhQYUZyesSv@BN8uUDOlm85HvQ/vbz1t53/CugZLHa1AVb0081222rBbd4EnD2w/rjfq/2YKY1Dekmv3w "C (gcc) – Try It Online")
## Ungolfed code
```
void fun(int b)
{
    for (int i = 1001; --i;) {
        if (i%b) {              /* no leading/trailing zeros */
            for (int a = i, z = 0; a != 0; a /= b) {
                if (a==z) {
                    printf("%d ",i);
                }
                z = z*b + a%b;
                if (a==z) {
                    printf("%d ",i);
                }
            }
        }
    }
    puts("0");
}
```
## Explanation
This outputs the numbers highest first, since no particular order was specified. For each candidate number, we reduce it (as `a`) by successively dividing by the base, using the remainder to build up the reverse number (in `z`). If `a` becomes equal to `z`, then we have a palindrome. Ordinarily, we'd stop there (`a >= z` in the loop condition), but for golfing, we continue all the way to `a==0`.
We need to test the equality both before and after transferring the remainder to `z`, to accept both odd and even length palindromes.
Finally, we print `0`, which is always a palindrome, and is easier to special-case than include in the loop.
The method works for integers up to `INT_MAX` if we ungolf the condition `i%b*a` back to `i%b&&a`, and would also work for other integer types.
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), 18 bytes
```
{&{x~|x}'x\'!1001}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqlqtuqKupqJWvSJGXdHQwMCw9n@auqGBgpGC5X8A "K (ngn/k) – Try It Online")
* `x\'!1001` convert each of 0..1000 to base-x representation
* `{x~|x}'` check if each representation is a palindrome
* `&` get indices of trues
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), ~~92~~ 85 bytes
```
lambda b:[i for i in range(1001)if(f:=lambda n:n*[0]and[n%b]+f(n//b))(i)==f(i)[::-1]]
```
[Try it online!](https://tio.run/##TYxBCsIwEEX3niIbYUYpTXSjAzlJmkVCnTig0xC68fSxiwpuPu/B49fP@lz0equtFz/1V3rnOZlMQQwvzYgRNS1peYCz1qEwMPm9UtJTsDHpHPSY45lBxzEjgqD3vG0gGlyMvTbRFcp2gXj4yeWP74j9Cw "Python 3.8 (pre-release) – Try It Online")
Thanks to [dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper) for saving 7 bytes!
[Answer]
# Haskell, 67 bytes
```
b&n=take n$mod n b:b&div n b
f b=[n|n<-[0..1000],reverse(b&n)==b&n]
```
`f` is the function of interest. [Try it online!](https://tio.run/##y0gszk7Nyfn/P0ktz7YkMTtVIU8lNz9FIU8hySpJLSWzDMTiSlNIso3Oq8mz0Y020NMzNDAwiNUpSi1LLSpO1QBq1LS1BZKx/3MTM/MUbBVS8rkUgKCgKDOvREEjTcHQQBNVwAiNb6n5HwA "Haskell – Try It Online")
Perhaps the only clever bit here is the use of `take n` to make a base case for the digit-expansion function. When `n=0`, `take n` ignores its argument and so the recursion stops via laziness; when `n>0`, there certainly won't be more than `n` digits so it's safe to keep only the first `n`. The following definition is equivalent (and equally long):
```
b&0=[]
b&n=mod n b:b&div n b
```
...but the `take n` version is more fun because it's more confusing. ^\_^
[Answer]
# [J](http://jsoftware.com/), 27 bytes
```
((-:|.)@(#.inv)"0#])i.@1001
```
## how
* `(...) i.@1001` - The whole thing is a J hook, meaning that the argument will be the left arg to everything in the parens, and the right arg will be the integers from 0 to 1000: `i.@1001`
* `...#]` The phrase inside the parens uses copy `#` to filter the right arg `]` by the boolean mask resulting from the phrase on the left of `#`:
* `(-:|.)@(#.inv)"0` - The rank 0 `"0` ensures the phrase applies to each individual number of the right arg. The phrase itself first converts each of those numbers to a list of digits in the base given by the left arg `(#.inv)`, and then checks if that list equals its reverse `(-:|.)@`. The entire phrase will thus return 1 when this is true and 0 otherwise, and this boolean mask will filter the right arg as desired.
[Try it online!](https://tio.run/##ZZJBbxQxDIXv8ytCi7S7kncUx3EcrwSqQOKEOPTeE6Jqe4AbF@hvX77ZhRMjfcrIk7Hfe8nLOd@cLMpD6eVtqSW3Z1lu1t1jeXcquyIUT3Bcy8f7z5/O@/3x9Hs93O1v1@fvPw839fbh8Lzeaa16PizLt69PP8pjadeX3e5fQev/lVqX5cuHtbTj@19VVExcQlLURUOaSgsxyibdxVWGyWCHyXRJk2RnDVFlZae27U8TZY9O3tPpkdJo0Zx3pyc/t9y6mlhzsU579ttknSG9MotevW8zXXqo9NyGK6BvsDJ9oGkgaiAj0BqbLvZO5k3@namS9EpUZ/jr1afWv0YbVjtmB3bnZphSu/ikSpk6H@bVofIZiENxoihWuipKlImKcmVaqw23QKNm0MFhQMCEZAiqru6BiYZaIzUjXCMdm4CrXrt0hQYGSOsOAwImJHLrlg6QphtsR4UHJxEPv6TlJDjqkKHQwKCDA2ZHwITEOCd6SZRTCIMOviUMpBKcUnCCs07ShgYGHRwGBBDfTCKsKcmpJLcjDTo4DAjgpnDjX89/AA "J – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~82~~ 81 bytes
(or [79 bytes](https://tio.run/##Zc1BCsIwEAXQq9RF4H8QrLiykKsoGZvoQMxIUnXTu6cH6LvAq11Ci/P9E7KWudo7Nt/TtzwWtQJhsgodtAzjdI4XasJB1zXkDASv7uTkhnHK9oQehXRO6H2NPwSS7WV/KPcFruwb) using the rather-complicated delimiter of "`\n[1]` ")
*Edit: -1 byte thanks to caird coinheringaahing*
```
function(b)for(i in 0:1e3)if(!i||all((a=i%/%b^(0:log(i,b))%%b)==rev(a)))cat(i,'')
```
[Try it online!](https://tio.run/##Zc1BCsIwEAXQq9RF6P8gWHFlIVdRZtpEBmIiaXXVu6fdu32bV5vKEubnR5LluZZ3WHyL3zytVjKUsVRYZ7kbxmu40SJOtm2SEiDe3MXpA8OYygt2VtI5pfc1/CAkJ1kP7nv@J7iz7Q "R – Try It Online")
Manually calculates digits in new base representation, and checks whether they are the same as themselves reversed.
```
function(b)
 for(i in 0:1000)               # loop i through zero to 1000
  if(!i                         # if i is zero (always a palindrome),
   ||                           # or
   all(                         # if all the digits of
    (a=i%/%b^(0:log(i,b))%%b)   # a = the representation of i in base b
    ==rev(a))                   # are the same as themselves reversed
  )cat(i,'')                    # output this i
```
[Answer]
# [Ruby 2.7](https://www.ruby-lang.org/), 74 bytes
```
->b{(0..1e3).select{(a=(g=->k,r=[]{k>0?g[k/b,r<<k%b]:r})[_1])==a.reverse}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6pWsNAT88w1VhTrzg1JzW5pLomr0Yj0VYj3VbXLlunyDY6tjrbzsA@PTpbP0mnyMYmWzUp1qqoVjM6L1bT1jZRryi1LLWoOLW29n@BQlq0oUEsF4g2glCWUMoy9j8A "Ruby – Try It Online")
TIO uses an older version of Ruby, whereas in Ruby 2.7, we've numbered parameters, which saves two bytes.
---
# [Ruby](https://www.ruby-lang.org/), 48 bytes
```
->b{(0..1e3).select{|k|(k=k.to_s b)==k.reverse}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6pWsNAT88w1VhTrzg1JzW5pLomu0Yj2zZbryQ/vlghSdMWyCxKLUstKk6trf1foJAWbWgQywWijSCUZex/AA "Ruby – Try It Online")
Doesn't works for bases over 64, due to the limitation in `.to_s` method.
[Answer]
# [JavaScript (V8)](https://v8.dev/), ~~77~~ 89 bytes
Fixed for bases greater than 36.
```
b=>{for(i=-1;i<1e3;){j=[],k=++i;while(k|=0)j.push(k%b),k/=b;''+j==j.reverse()&&print(i)}}
```
[Try it online!](https://tio.run/##FcRBDsIgEADAu/@w3Q1tLXqxoetHjIdiIF0wSqDiofbtGOcwbspTukcOS5vPxVLRdFntKwJTKxWP0pwUro6ut8aTEKw@Mz8M@C/16LrwTjP4vcbGH0iruhaOyHXRZBOTAayqEPm5AOO2FQuyx52F478Byw8 "JavaScript (V8) – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 102 100 98 95 87 75 bytes
-14 bytes thanks to mazzy!
```
param($u)0..1e3|?{for($b=@();$_=($_-($b+=$_%$u)[-1])/$u){}"$b"-eq$b[11..0]}
```
[Try it online!](https://tio.run/##hZDBToQwEIbvPMWEzJo2CFI9qWkkevHEycQDIQTMbCRhAduSPbB9dizguptsjHPpPzP/fDNp3@1J6U9qmgm3Q/th6q6VHrgYp75U5Y7hwOMoEnR3eBq3nWJYyYTxRywkwyJ0aSCx2DhXFoqc3zgxWh8rP6QvrDIhoijO7TQTrYeGtHkpNWmQkLBlTzIuzxx12w9mFnPzni91e/2X4fY/g4h/HB4/33yADYxLng67ipQUdgXgOi0Bi2iRa1WRHpq5fPX7Q5Cc@u@qNhS@dtqAn705Kpyx8@zZ7QRkRyTPfbiMMO1S2jd1SxfIh@MB/nrNiR0Enp2@AQ "PowerShell – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `M`, 7 bytes
```
k1'⁰τḂ⁼
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJNIiwiIiwiazEn4oGwz4ThuILigbwiLCIiLCIyIl0=)
[Answer]
# [jq](https://stedolan.github.io/jq/), 66 bytes
```
. as$a|range(1001)|select([while(.>0;./$a|floor)|.%$a]|reverse==.)
```
[Try it online!](https://tio.run/##yyr8/19PIbFYJbGmKDEvPVXD0MDAULOmODUnNblEI7o8IzMnVUPPzsBaTx@oJC0nP79Is0ZPVSUxtqYotSy1qDjV1lZP8/9/SwA "jq – Try It Online")
## Explanation
```
. as $a |                # Assign the input to $a.
range(1001) |            # For every item in [0..1000]:
select (                 # Filter out all items where:
  [ while(. > 0;         #     The list of quotients from repeatedly
     . / $a | floor)     #     short-dividing by $a
      |. % $a]           #     And then modulo-ing by $a
  | reverse == .)        # is equal to its reverse
```
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 11 bytes
```
f_IjTQUh^T3
```
[Try it online!](https://tio.run/##K6gsyfj/Py3eMyskMDQjLsT4/38jAA "Pyth – Try It Online")
---
```
f_IjTQUh^T3 | Explanation
------------+---------------------------------------
f           | filter
      Uh^T3 | the range [0, 1001)
   jTQ      | on whether each number in base <input>
 _I         | equals itself reversed
```
[Answer]
# Java 10, 118 bytes
```
b->{for(int i=-1;i++<1e3;){var s=b.toString(i,b);if(s.contains(new StringBuffer(s).reverse()))System.out.println(i);}}
```
[Try it online.](https://tio.run/##jVA9T8MwEN37K06dbCWxCEw0hAGmDpShY9XBcS@VS@pE9iUIRf7twfkoE0gsJ927d@@9u4vsZHI5fQyqks7Bm9SmXwFoQ2hLqRB2YwvQ1foEim0DfkYLBc8C7FehOJKkFezAQD4UyXNf1paFfdB5kmY6ip5SfMh430kLLi8E1Xuy2pyZjoOKLpkTqjYUjB0z@Anz9KUtS7TMcWGxQ@uQcc73X47wKuqWRBNIVBmmeeb9kI1BmraoQpAlzxT4GlTZLHg4guTzLbeAhI5epUPYwGgcoMOxT@/i@/jRL1SAXzzXW9O0tIF1dFOYvvEX@72lmf7DMkKx/6wuMz@92g/f)
**Explanation:**
```
b->{                           // Method with Integer parameter and no return-type
  for(int i=-1;i++<1e3;){      //  Loop `i` in the range [0,1000]:
    var s=b.toString(i,b);     //   Convert `i` to base-`b` as String
    if(s.contains(new StringBuffer(s).reverse()))
                               //   If this String is a palindrome:
      System.out.println(i);}} //    Print `i` with trailing newline
```
[Answer]
# [Factor](https://factorcode.org/), ~~53~~ 52 bytes
```
[ 1e3 [0,b] swap '[ _ >base dup reverse = ] filter ]
```
[Try it online!](https://tio.run/##XY4xC8IwFIR3f8VtLhJanVQUN3FxEadSJI0vNdgm8SVV@uvrAzdv/O6OO6tNDjxdL6fzcYNe54di7VtKeBJ76mB5/OGoOREj0WsgbyQQmXIeIzuf4XVPKeo/rEzw1rVwAdvZrCywxHqqUNIKVbFoaqSPjphXuGHf6ES4DxFMb5Il7FDDui7LZi0lpRR8J8yEPgbxy0Ik17h1Xl5lZHaH6Qs "Factor – Try It Online")
]